|
Cataclysm DDA
|
#include <npc.h>
Public Member Functions | |
| npc () | |
| npc (const npc &)=delete | |
| npc (npc &&) noexcept(map_is_noexcept) | |
| npc & | operator= (const npc &)=delete |
| npc & | operator= (npc &&) noexcept(list_is_noexcept) |
| ~npc () override | |
| bool | is_avatar () const override |
| bool | is_npc () const override |
| npc * | as_npc () override |
| const npc * | as_npc () const override |
| void | load_npc_template (const string_id< npc_template > &ident) |
| void | npc_dismount () |
| void | randomize (const npc_class_id &type=npc_class_id::NULL_ID(), const npc_template_id &tem_id=npc_template_id::NULL_ID()) |
| void | randomize_from_faction (faction *fac) |
| void | apply_ownership_to_inv () |
| void | clear_personality_traits () |
| void | generate_personality_traits () |
| void | learn_ma_styles_from_traits () |
| int | get_faction_ver () const |
| void | set_faction_ver (int new_version) |
| bool | has_faction_relationship (const Character &you, npc_factions::relationship flag) const |
| void | set_fac (const faction_id &id) |
| faction * | get_faction () const override |
| faction_id | get_fac_id () const |
| void | spawn_at_omt (const tripoint_abs_omt &p) |
| Spawns the NPC on a random square within the given OMT. More... | |
| void | spawn_at_precise (const tripoint_abs_ms &p) |
| Spawns the NPC on the specified map square. More... | |
| void | place_on_map () |
| Places the NPC on the map. More... | |
| void | add_new_mission (mission *miss) |
| See dialogue_chatbin::add_new_mission. More... | |
| void | update_missions_target (character_id old_character, character_id new_character) |
| std::pair< skill_id, int > | best_combat_skill (combat_skills subset) const |
| void | starting_weapon (const npc_class_id &type) |
| void | deserialize (const JsonObject &data) override |
| void | serialize (JsonOut &json) const override |
| void | export_to (const cata_path &path) const |
| void | import_and_clean (const cata_path &path) |
| Read json and apply post-import cleanup. More... | |
| nc_color | basic_symbol_color () const override |
| Creature symbol color. More... | |
| int | print_info (const catacurses::window &w, int line, int vLines, int column) const override |
| Write information about this creature. More... | |
| std::string | opinion_text () const |
| int | faction_display (const catacurses::window &fac_w, int width) const |
| std::string | describe_mission () const |
| std::string | name_and_activity () const |
| std::string | name_and_maybe_activity () const override |
| std::string | get_current_status () const |
| Returns current status (Sleeping, Guarding, In Combat, etc.), or current activity. More... | |
| std::string | get_current_activity () const |
| Returns the current activity name (reading, disassembling, etc.), or "nothing". More... | |
| void | form_opinion (const Character &you) |
| npc_opinion | get_opinion_values (const Character &you) const |
| std::string | pick_talk_topic (const Character &u) |
| std::string const & | get_specified_talk_topic (std::string const &topic_id) |
| float | character_danger (const Character &u) const |
| float | vehicle_danger (int radius) const |
| void | pretend_fire (npc *source, int shots, item &gun) |
| bool | turned_hostile () const |
| int | hostile_anger_level () const |
| void | make_angry () |
| void | on_attacked (const Creature &attacker) |
| int | assigned_missions_value () |
| bool | is_enemy () const |
| bool | is_following () const |
| bool | is_obeying (const Character &p) const override |
| bool | is_hallucination () const override |
| bool | is_electrical () const override |
| bool | is_friendly (const Character &p) const |
| bool | is_leader () const |
| bool | is_walking_with () const |
| bool | is_ally (const Character &p) const override |
| bool | is_player_ally () const |
| bool | is_stationary (bool include_guards=true) const |
| bool | is_guarding () const |
| bool | is_patrolling () const |
| bool | within_boundaries_of_camp () const |
| bool | has_player_activity () const |
| is performing a player_activity More... | |
| bool | is_travelling () const |
| bool | is_minion () const |
| Trusts you a lot. More... | |
| bool | guaranteed_hostile () const |
| Is enemy or will turn into one (can't be convinced not to attack). More... | |
| Attitude | attitude_to (const Creature &other) const override |
| Attitude (of this creature) towards another creature. More... | |
| void | mutiny () |
| mfaction_id | get_monster_faction () const override |
| For mutant NPCs. More... | |
| int | follow_distance () const |
| void | shop_restock () |
| std::string | get_restock_interval () const |
| bool | is_shopkeeper () const |
| int | minimum_item_value () const |
| void | update_worst_item_value () |
| double | value (const item &it) const |
| double | value (const item &it, double market_price) const |
| faction_price_rule const * | get_price_rules (item const &it) const |
| bool | wear_if_wanted (const item &it, std::string &reason) |
| bool | can_read (const item &book, std::vector< std::string > &fail_reasons) |
| time_duration | time_to_read (const item &book, const Character &reader) const |
| void | do_npc_read (bool ebook=false) |
| void | stow_item (item &it) |
| bool | wield (item &it) override |
| Removes currently wielded item (if any) and replaces it with the target item. More... | |
| void | drop (const drop_locations &what, const tripoint &target, bool stash) override |
| bool | adjust_worn () |
| bool | has_healing_item (healing_options try_to_fix) |
| healing_options | patient_assessment (const Character &c) |
| healing_options | has_healing_options () |
| healing_options | has_healing_options (healing_options try_to_fix) |
| item & | get_healing_item (healing_options try_to_fix, bool first_best=false) |
| bool | has_painkiller () |
| bool | took_painkiller () const |
| void | use_painkiller () |
| void | activate_item (item &it) |
| bool | has_identified (const itype_id &) const override |
| Note that we've read a book at least once. More... | |
| void | identify (const item &) override |
| bool | will_accept_from_player (const item &it) const |
| Is the item safe or does the NPC trust you enough? Is not recursive, only checks the item that is the parameter. More... | |
| bool | wants_to_sell (const item_location &it) const |
| ret_val< void > | wants_to_sell (const item_location &it, int at_price) const |
| bool | wants_to_buy (const item &it) const |
| ret_val< void > | wants_to_buy (const item &, int at_price) const |
| bool | will_exchange_items_freely () const |
| int | max_credit_extended () const |
| int | max_willing_to_owe () const |
| void | regen_ai_cache () |
| const Creature * | current_target () const |
| Creature * | current_target () |
| const Creature * | current_ally () const |
| Creature * | current_ally () |
| tripoint | good_escape_direction (bool include_pos=true) |
| float | danger_assessment () const |
| float | average_damage_dealt () |
| bool | bravery_check (int diff) const |
| bool | emergency () const |
| bool | emergency (float danger) const |
| bool | is_active () const |
| template<typename ... Args> | |
| void | say (const char *const line, Args &&... args) const |
| void | say (const std::string &line, sounds::sound_t spriority=sounds::sound_t::speech) const |
| int | indoor_voice () const |
| void | decide_needs () |
| void | reboot () |
| void | die (Creature *killer) override |
| Empty function. More... | |
| bool | is_dead () const |
| void | prevent_death () override |
| int | smash_ability () const override |
| void | activate_combat_cbms () |
| void | deactivate_combat_cbms () |
| bool | recharge_cbm () |
| bool | wants_to_recharge_cbm () |
| bool | can_use_offensive_cbm () const |
| bool | use_bionic_by_id (const bionic_id &cbm_id, bool eff_only=false) |
| bool | activate_bionic_by_id (const bionic_id &cbm_id, bool eff_only=false) |
| bool | deactivate_bionic_by_id (const bionic_id &cbm_id, bool eff_only=false) |
| void | discharge_cbm_weapon (bool fired=true, bool stow_real_weapon=false) |
| void | deactivate_or_discharge_bionic_weapon (bool stow_real_weapon=false) |
| void | check_or_use_weapon_cbm (const bionic_id &cbm_id) |
| void | activate_combat_items () |
| void | deactivate_combat_items () |
| void | prepare_for_combat () |
| void | cleanup_on_no_danger () |
| bool | complain_about (const std::string &issue, const time_duration &dur, const std::string &speech, bool force=false, sounds::sound_t priority=sounds::sound_t::speech) |
| void | warn_about (const std::string &type, const time_duration &d=10_minutes, const std::string &name="", int range=-1, const tripoint &danger_pos=tripoint_zero) |
| std::string | distance_string (int range) const |
| bool | complain () |
| void | handle_sound (sounds::sound_t priority, const std::string &description, int heard_volume, const tripoint &spos) |
| void | witness_thievery (item *it) override |
| void | shift (const point &s) |
| void | move () |
| void | execute_action (npc_action action) |
| void | process_turn () override |
| Handles end-of-turn processing. More... | |
| bool | invoke_item (item *, const tripoint &pt, int pre_obtain_moves) override |
| Asks how to use the item (if it has more than one use_method) and uses it. More... | |
| bool | invoke_item (item *used, const std::string &method) override |
| bool | invoke_item (item *) override |
| As above two, but with position equal to current position. More... | |
| float | evaluate_monster (const monster &target, int dist) const |
| rates how dangerous a target is More... | |
| float | evaluate_character (const Character &candidate, bool my_gun, bool enemy) |
| float | evaluate_self (bool my_gun) |
| void | assess_danger () |
| void | act_on_danger_assessment () |
| bool | is_safe () const |
| npc_action | method_of_fleeing () |
| npc_action | method_of_attack () |
| void | evaluate_best_attack (const Creature *target) |
| float | estimate_armour (const Character &candidate) const |
| npc_action | address_needs () |
| npc_action | address_needs (float danger) |
| npc_action | address_player () |
| npc_action | long_term_goal_action () |
| int | evaluate_sleep_spot (tripoint_bub_ms p) |
| bool | scan_new_items () |
| double | evaluate_weapon (item &maybe_weapon, bool can_use_gun, bool use_silent) const |
| item * | evaluate_best_weapon () const |
| bool | wield_better_weapon () |
| double | confidence_mult () const |
| int | confident_shoot_range (const item &it, int at_recoil) const |
| int | confident_gun_mode_range (const gun_mode &gun, int at_recoil) const |
| int | confident_throw_range (const item &, Creature *) const |
| void | invalidate_range_cache () |
| bool | wont_hit_friend (const tripoint &tar, const item &it, bool throwing) const |
| bool | enough_time_to_reload (const item &gun) const |
| bool | can_reload_current () |
| Can reload currently wielded gun? More... | |
| item_location | find_reloadable () |
| Has a gun or magazine that can be reloaded. More... | |
| item_location | find_usable_ammo (const item_location &weap) |
| Finds ammo the NPC could use to reload a given object. More... | |
| item_location | find_usable_ammo (const item_location &weap) const |
| item::reload_option | select_ammo (const item_location &base, bool prompt=false, bool empty=true) override |
| Select suitable ammo with which to reload the item. More... | |
| bool | dispose_item (item_location &&obj, const std::string &prompt=std::string()) override |
| Drop, wear, stash or otherwise try to dispose of an item consuming appropriate moves. More... | |
| void | update_cardio_acc () override |
| void | aim (const Target_attributes &target_attributes) |
| void | do_reload (const item_location &it) |
| bool | update_path (const tripoint &p, bool no_bashing=false, bool force=true) |
| Tries to find path to p. More... | |
| bool | update_path (const tripoint_bub_ms &p, bool no_bashing=false, bool force=true) |
| void | set_guard_pos (const tripoint_abs_ms &p) |
| bool | can_open_door (const tripoint &p, bool inside) const |
| bool | can_move_to (const tripoint &p, bool no_bashing=false) const |
| void | move_to (const tripoint &p, bool no_bashing=false, std::set< tripoint > *nomove=nullptr) |
| void | move_to_next () |
| void | avoid_friendly_fire () |
| void | escape_explosion () |
| void | move_away_from (const tripoint &p, bool no_bash_atk=false, std::set< tripoint > *nomove=nullptr) |
| void | move_away_from (const std::vector< sphere > &spheres, bool no_bashing=false) |
| void | worker_downtime () |
| bool | find_job_to_perform () |
| void | move_pause () |
| void | set_movement_mode (const move_mode_id &mode) override |
| const pathfinding_settings & | get_pathfinding_settings () const override |
| Returns settings for pathfinding. More... | |
| const pathfinding_settings & | get_pathfinding_settings (bool no_bashing) const |
| std::unordered_set< tripoint > | get_path_avoid () const override |
| Returns a set of points we do not want to path through. More... | |
| void | see_item_say_smth (const itype_id &object, const std::string &smth) |
| bool | can_take_that (const item &it) |
| bool | wants_take_that (const item &it) |
| bool | would_take_that (const item &it, const tripoint &p) |
| void | find_item () |
| void | pick_up_item () |
| std::list< item > | pick_up_item_map (const tripoint &where) |
| Picks up items and returns a list of them. More... | |
| std::list< item > | pick_up_item_vehicle (vehicle &veh, int part_index) |
| bool | has_item_whitelist () const |
| bool | item_name_whitelisted (const std::string &to_match) |
| bool | item_whitelisted (const item &it) |
| bool | find_corpse_to_pulp () |
| Returns true if it finds one. More... | |
| bool | can_do_pulp () |
| Returns true if NPC can do pulp in this turn. More... | |
| bool | do_player_activity () |
| perform a player activity, returning true if it took up the turn More... | |
| bool | alt_attack () |
| void | heal_player (Character &patient) |
| void | heal_self () |
| void | pretend_heal (Character &patient, item used) |
| void | mug_player (Character &mark) |
| void | look_for_player (const Character &sought) |
| bool | saw_player_recently () const |
| bool | consume_food () |
| Returns true if food was consumed, false otherwise. More... | |
| bool | consume_food_from_camp () |
| int | get_thirst () const override |
| bool | has_omt_destination () const |
| void | set_omt_destination () |
| void | go_to_omt_destination () |
| void | reach_omt_destination () |
| void | guard_current_pos () |
| void | add_msg_if_npc (const std::string &msg) const override |
| void | add_msg_if_npc (const game_message_params ¶ms, const std::string &msg) const override |
| void | add_msg_player_or_npc (const std::string &player_msg, const std::string &npc_msg) const override |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_msg) const override |
| void | add_msg_if_player (const std::string &) const override |
| void | add_msg_if_player (const game_message_params &, const std::string &) const override |
| void | add_msg_player_or_say (const std::string &player_msg, const std::string &npc_speech) const override |
| void | add_msg_player_or_say (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_speech) const override |
| bool | query_yn (const std::string &mes) const override |
| std::string | extended_description () const override |
| std::string | get_epilogue () const |
| std::pair< std::string, nc_color > | hp_description () const |
| float | speed_rating () const override |
| Returns an approximate number of tiles this creature can travel per turn. More... | |
| void | travel_overmap (const tripoint_abs_omt &pos) |
| Note: this places NPC on a given position in CURRENT MAP coordinates. More... | |
| npc_attitude | get_attitude () const override |
| void | set_attitude (npc_attitude new_attitude) |
| void | set_mission (npc_mission new_mission) |
| bool | has_activity () const |
| bool | has_job () const |
| npc_attitude | get_previous_attitude () |
| npc_mission | get_previous_mission () const |
| void | revert_after_activity () |
| void | do_npc_craft (const std::optional< tripoint > &loc=std::nullopt, const recipe_id &goto_recipe=recipe_id()) |
| item_location | get_item_to_craft () |
| const std::vector< weak_ptr_fast< Creature > > & | get_cached_friends () const |
| std::optional< int > | closest_enemy_to_friendly_distance () const |
| const dialogue_chatbin_snippets & | chat_snippets () const |
| const std::shared_ptr< npc_attack > & | get_current_attack () const |
| const npc_attack_rating & | get_current_attack_evaluation () const |
| void | on_unload () |
| Do some cleanup and caching as npc is being unloaded from map. More... | |
| void | on_load () |
| Retroactively update npc. More... | |
| void | npc_update_body () |
| Update body, but throttled. More... | |
| bool | get_known_to_u () const |
| void | set_known_to_u (bool known) |
| void | set_companion_mission (npc &p, const mission_id &miss_id) |
| Set up (start) a companion mission. More... | |
| void | set_companion_mission (const tripoint_abs_omt &omt_pos, const std::string &role_id, const mission_id &miss_id) |
| void | set_companion_mission (const tripoint_abs_omt &omt_pos, const std::string &role_id, const mission_id &miss_id, const tripoint_abs_omt &destination) |
| void | reset_companion_mission () |
Unset a companion mission. Precondition: !has_companion_mission() More... | |
| std::optional< tripoint_abs_omt > | get_mission_destination () const |
| bool | has_companion_mission () const |
| npc_companion_mission | get_companion_mission () const |
| attitude_group | get_attitude_group (npc_attitude att) const |
| void | set_unique_id (const std::string &id) |
| std::string | get_unique_id () const |
| virtual bool | invoke_item (item *, const tripoint &pt, int pre_obtain_moves=-1) |
| Asks how to use the item (if it has more than one use_method) and uses it. More... | |
| virtual bool | invoke_item (item *, const std::string &, const tripoint &pt, int pre_obtain_moves=-1) |
| As above, but with a pre-selected method. More... | |
| virtual bool | invoke_item (item *) |
| As above two, but with position equal to current position. More... | |
| virtual bool | invoke_item (item *, const std::string &) |
| void | add_msg_player_or_npc (const std::string &player_msg, const std::string &npc_str) const override |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_msg) const override |
| virtual void | add_msg_player_or_npc (const std::string &, const std::string &) const |
| virtual void | add_msg_player_or_npc (const game_message_params &, const std::string &, const std::string &) const |
| void | add_msg_player_or_npc (const translation &, const translation &) const |
| void | add_msg_player_or_npc (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| void | add_msg_if_player (const std::string &msg) const override |
| void | add_msg_if_player (const game_message_params ¶ms, const std::string &msg) const override |
| virtual void | add_msg_if_player (const std::string &) const |
| virtual void | add_msg_if_player (const game_message_params &, const std::string &) const |
| void | add_msg_if_player (const translation &) const |
| void | add_msg_if_player (const game_message_params &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const translation &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const translation &msg, Args &&... args) const |
| void | add_msg_player_or_say (const std::string &player_msg, const std::string &npc_speech) const override |
| void | add_msg_player_or_say (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_speech) const override |
| virtual void | add_msg_player_or_say (const std::string &, const std::string &) const |
| virtual void | add_msg_player_or_say (const game_message_params &, const std::string &, const std::string &) const |
| void | add_msg_player_or_say (const translation &, const translation &) const |
| void | add_msg_player_or_say (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const translation &player_msg, const translation &npc_speech, Args &&... args) const |
Public Member Functions inherited from Character | |
| Character (const Character &)=delete | |
| Character & | operator= (const Character &)=delete |
| ~Character () override | |
| void | initialize (bool learn_recipes=true) |
| Character * | as_character () override |
| const Character * | as_character () const override |
| character_id | getID () const |
| void | setID (character_id i, bool force=false) |
| sets the ID, will only succeed when the current id is not valid allows forcing a -1 id which is required for templates to not throw errors More... | |
| field_type_id | bloodType () const override |
| field_type_id | gibType () const override |
| bool | is_warm () const override |
| bool | in_species (const species_id &spec) const override |
| int | get_str () const |
| Getters for stats exclusive to characters. More... | |
| int | get_dex () const |
| int | get_per () const |
| int | get_int () const |
| int | get_str_base () const |
| int | get_dex_base () const |
| int | get_per_base () const |
| int | get_int_base () const |
| int | get_str_bonus () const |
| int | get_dex_bonus () const |
| int | get_per_bonus () const |
| int | get_int_bonus () const |
| int | get_arms_power_use () const |
| Getters for above stats. More... | |
| int | get_legs_power_use () const |
| float | get_arms_stam_mult () const |
| float | get_legs_stam_mult () const |
| std::vector< speed_bonus_effect > | get_speed_bonus_effects () const |
| int | get_speed () const override |
| int | get_enchantment_speed_bonus () const |
| int | get_arm_str () const |
| int | get_eff_per () const override |
| int | ranged_dex_mod () const |
| int | ranged_per_mod () const |
| void | set_str_bonus (int nstr) |
| Setters for stats exclusive to characters. More... | |
| void | set_dex_bonus (int ndex) |
| void | set_per_bonus (int nper) |
| void | set_int_bonus (int nint) |
| void | mod_str_bonus (int nstr) |
| void | mod_dex_bonus (int ndex) |
| void | mod_per_bonus (int nper) |
| void | mod_int_bonus (int nint) |
| void | mod_speed_bonus (int nspeed, const std::string &desc) |
| int | get_lifestyle () const |
| Getters for health values exclusive to characters. More... | |
| int | get_daily_health () const |
| int | get_health_tally () const |
| void | mod_livestyle (int nhealthy) |
| Modifiers for health values exclusive to characters. More... | |
| void | mod_daily_health (int nhealthy_mod, int cap) |
| void | mod_health_tally (int mod) |
| void | set_lifestyle (int nhealthy) |
| Setters for health values exclusive to characters. More... | |
| void | set_daily_health (int nhealthy_mod) |
| int | get_stored_kcal () const |
| Getter for need values exclusive to characters. More... | |
| int | get_healthy_kcal () const |
| float | get_kcal_percent () const |
| int | kcal_speed_penalty () const |
| int | get_hunger () const |
| int | get_starvation () const |
| virtual int | get_instant_thirst () const |
| time_duration | get_daily_sleep () const |
| void | mod_daily_sleep (time_duration mod) |
| void | reset_daily_sleep () |
| time_duration | get_continuous_sleep () const |
| void | mod_continuous_sleep (time_duration mod) |
| void | reset_continuous_sleep () |
| int | get_sleepiness () const |
| int | get_sleep_deprivation () const |
| void | mod_stored_kcal (int nkcal, bool ignore_weariness=false) |
| Modifiers for need values exclusive to characters. More... | |
| void | mod_hunger (int nhunger) |
| void | mod_thirst (int nthirst) |
| void | mod_sleepiness (int nsleepiness) |
| void | mod_sleep_deprivation (int nsleep_deprivation) |
| void | set_stored_kcal (int kcal) |
| Setters for need values exclusive to characters. More... | |
| void | set_hunger (int nhunger) |
| void | set_thirst (int nthirst) |
| void | set_sleepiness (int nsleepiness) |
| void | set_sleepiness (sleepiness_levels nsleepiness) |
| void | set_sleep_deprivation (int nsleep_deprivation) |
| void | gravity_check () |
| void | stagger () |
| void | mod_stat (const std::string &stat, float modifier) override |
| int | get_standard_stamina_cost (const item *thrown_item=nullptr) const |
| int | get_fat_to_hp () const |
| Get bonus to max_hp from excess stored fat. More... | |
| creature_size | get_size () const override |
| Get size class of character. More... | |
| void | recalculate_size () |
| Recalculate size class of character. More... | |
| std::string | disp_name (bool possessive=false, bool capitalize_first=false) const override |
| Returns either "you" or the player's name. More... | |
| std::string | skin_name () const override |
| Returns the name of the player's outer layer, e.g. More... | |
| void | set_fac_id (const std::string &my_fac_id) |
| const profession * | get_profession () const |
| std::set< const profession * > | get_hobbies () const |
| bool | has_mission_item (int mission_id) const |
| int | effective_dispersion (int dispersion, bool zoom=false) const |
| int | get_character_parallax (bool zoom=false) const |
| std::vector< aim_type > | get_aim_types (const item &gun) const |
| int | point_shooting_limit (const item &gun) const |
| double | fastest_aiming_method_speed (const item &gun, double recoil, const Target_attributes &target_attributes=Target_attributes(), std::optional< std::reference_wrapper< const parallax_cache >> parallax_cache=std::nullopt) const |
| int | most_accurate_aiming_method_limit (const item &gun) const |
| double | aim_factor_from_volume (const item &gun) const |
| double | aim_factor_from_length (const item &gun) const |
| aim_mods_cache | gen_aim_mods_cache (const item &gun) const |
| float | get_modifier (const character_modifier_id &mod, const skill_id &skill=skill_id::NULL_ID()) const |
| bool | has_gun_for_ammo (const ammotype &at) const |
| Check whether the player has a gun that uses the given type of ammo. More... | |
| bool | has_magazine_for_ammo (const ammotype &at) const |
| double | aim_per_move (const item &gun, double recoil, const Target_attributes &target_attributes=Target_attributes(), std::optional< std::reference_wrapper< const aim_mods_cache >> aim_cache=std::nullopt) const |
| int | get_dodges_left () const |
| void | set_dodges_left (int dodges) |
| void | mod_dodges_left (int mod) |
| void | consume_dodge_attempts () |
| ret_val< void > | can_try_doge (bool ignore_dodges_left=false) const |
| float | get_stamina_dodge_modifier () const |
| void | on_dodge (Creature *source, float difficulty, float training_level=0.0f) override |
| Called after the player has successfully dodged an attack. More... | |
| void | on_try_dodge () override |
| Called after the player has tryed to dodge an attack. More... | |
| float | get_dodge_base () const override |
| Combat getters. More... | |
| float | dodge_roll () const override |
| Returns the player's dodge_roll to be compared against an aggressor's hit_roll() More... | |
| float | get_dodge () const override |
| Returns Creature::get_dodge() modified by any Character effects. More... | |
| int | get_spell_resist () const override |
| in this case spell resistance is just the spellcraft skill for characters. More... | |
| bool | uncanny_dodge () override |
| Handles the uncanny dodge bionic and effects, returns true if the player successfully dodges. More... | |
| bool | check_avoid_friendly_fire () const override |
| float | get_hit_base () const override |
| void | tally_organic_size () |
| total hitsize of all non cybernetic body parts More... | |
| float | get_cached_organic_size () const |
| void | recalc_limb_energy_usage () |
| Called on limb change to update the usage values. More... | |
| int | sight_range (float light_level) const override |
| Returns the player's sight range. More... | |
| int | unimpaired_range () const |
| Returns the player maximum vision range factoring in mutations, diseases, and other effects. More... | |
| bool | overmap_los (const tripoint_abs_omt &omt, int sight_points) const |
| Returns true if overmap tile is within player line-of-sight. More... | |
| int | overmap_sight_range (float light_level) const |
| Returns the distance the player can see on the overmap. More... | |
| int | clairvoyance () const |
| Returns the distance the player can see through walls. More... | |
| bool | sight_impaired () const |
| Returns true if the player has some form of impaired sight. More... | |
| bool | has_alarm_clock () const |
| Returns true if the player or their vehicle has an alarm clock. More... | |
| bool | has_watch () const |
| Returns true if the player or their vehicle has a watch. More... | |
| void | action_taken () |
| Called after every action, invalidates player caches. More... | |
| bool | is_on_ground () const override |
| Returns true if the player is knocked over, has broken legs or is lying down. More... | |
| int | swim_speed () const |
| Returns the player's movecost for swimming across water tiles. More... | |
| float | get_melee () const override |
| Returns melee skill level, to be used to throttle dodge practice. More... | |
| void | add_miss_reason (const std::string &reason, unsigned int weight) |
| Adds a reason for why the player would miss a melee attack. More... | |
| void | clear_miss_reasons () |
| Clears the list of reasons for why the player would miss a melee attack. More... | |
| std::string | get_miss_reason () |
| Returns an explanation for why the player would miss a melee attack. More... | |
| void | regen (int rate_multiplier) |
| Handles passive regeneration of pain and maybe hp. More... | |
| ret_val< void > | can_takeoff (const item &it, const std::list< item > *res=nullptr) |
| Check player capable of taking off an item. More... | |
| std::pair< int, int > | gunmod_installation_odds (const item_location &gun, const item &mod) const |
| void | recalc_speed_bonus () |
| Calculates the various speed bonuses we will get from mutations, etc. More... | |
| void | set_underwater (bool) |
| bool | is_fae () const override |
| bool | is_nether () const override |
| bool | has_mind () const override |
| stat_mod | get_pain_penalty () const |
| Returns the effect of pain on stats. More... | |
| int | get_lift_str () const |
| returns players strength adjusted by any traits that affect strength during lifting jobs More... | |
| bool | takeoff (item_location loc, std::list< item > *res=nullptr) |
| Takes off an item, returning false on fail. More... | |
| bool | takeoff (int pos) |
| virtual void | update_health () |
| Handles health fluctuations over time. More... | |
| void | update_body () |
| Updates all "biology" by one turn. More... | |
| void | update_body (const time_point &from, const time_point &to) |
Updates all "biology" as if time between from and to passed. More... | |
| void | update_stomach (const time_point &from, const time_point &to) |
| Updates the stomach to give accurate hunger messages. More... | |
| void | update_enchantment_mutations () |
| Updates the mutations from enchantments. More... | |
| bool | needs_food () const |
| Returns true if character needs food, false if character is an NPC with NO_NPC_FOOD set. More... | |
| void | update_needs (int rate_multiplier) |
| Increases hunger, thirst, sleepiness and stimulants wearing off. More... | |
| needs_rates | calc_needs_rates () const |
| void | calc_sleep_recovery_rate (needs_rates &rates) const |
| void | check_needs_extremes () |
| Kills the player if too hungry, stimmed up etc., forces tired player to sleep and prints warnings. More... | |
| void | get_sick (bool is_flu=false) |
| Handles the chance to be infected by random diseases. More... | |
| bool | is_hibernating () const |
| Returns if the player has hibernation mutation and is asleep and well fed. More... | |
| void | update_bodytemp () |
| Maintains body temperature. More... | |
| void | update_frostbite (const bodypart_id &bp, int FBwindPower, const std::map< bodypart_id, int > &warmth_per_bp) |
| void | temp_equalizer (const bodypart_id &bp1, const bodypart_id &bp2) |
| Equalizes heat between body parts. More... | |
| comfort_response_t | base_comfort_value (const tripoint_bub_ms &p) const |
| Rate point's ability to serve as a bed. More... | |
| int | focus_equilibrium_sleepiness_cap (int equilibrium) const |
| Returns focus equilibrium cap due to sleepiness. More... | |
| int | calc_focus_equilibrium (bool ignore_pain=false) const |
| Uses morale and other factors to return the character's focus target goto value. More... | |
| int | calc_focus_change () const |
| Calculates actual focus gain/loss value from focus equilibrium. More... | |
| void | update_mental_focus () |
| Uses calc_focus_change to update the character's current focus. More... | |
| void | reset_bonuses () override |
| Resets the value of all bonus fields to 0. More... | |
| void | reset_stats () override |
| Resets stats, and applies effects in an idempotent manner. More... | |
| void | reset () override |
| Handles stat and bonus reset. More... | |
| int | encumb (const bodypart_id &bp) const |
| Returns ENC provided by armor, etc. More... | |
| int | avg_encumb_of_limb_type (body_part_type::type part_type) const |
| units::mass | get_weight () const override |
| Returns body weight plus weight of inventory and worn/wielded items. More... | |
| void | print_encumbrance (ui_adaptor &ui, const catacurses::window &win, int line=-1, const item *selected_clothing=nullptr) const |
| bool | is_wearing_power_armor (bool *hasHelmet=nullptr) const |
| Returns true if the character is wearing power armor. More... | |
| bool | is_wearing_active_power_armor () const |
| Returns true if the character is wearing active power. More... | |
| bool | is_wearing_active_optcloak () const |
| Returns true if the player is wearing an active optical cloak. More... | |
| std::pair< int, int > | climate_control_strength () const |
| Returns strength of any climate control affecting character, for heating and chilling respectively. More... | |
| std::map< bodypart_id, int > | get_wind_resistance (const std::map< bodypart_id, std::vector< const item * >> &clothing_map) const |
| Returns wind resistance provided by armor, etc. More... | |
| bool | is_blind () const |
| Returns true if the player isn't able to see. More... | |
| bool | is_invisible () const |
| int | visibility (bool check_color=false, int stillness=0) const |
| Checks is_invisible() as well as other factors. More... | |
| float | active_light () const |
| Returns character luminosity based on the brightest active item they are carrying. More... | |
| bool | sees_with_specials (const Creature &critter) const |
| body_part_set | exclusive_flag_coverage (const flag_id &flag) const |
Bitset of all the body parts covered only with items with flag (or nothing) More... | |
| bool | move_effects (bool attacking) override |
| Processes effects which may prevent the Character from moving (bear traps, crushed, etc.). More... | |
| void | wait_effects (bool attacking=false) |
| bool | try_remove_grab (bool attacking=false) |
| Series of checks to remove effects for waiting or moving. More... | |
| void | try_remove_downed () |
| void | try_remove_bear_trap () |
| void | try_remove_lightsnare () |
| void | try_remove_heavysnare () |
| void | try_remove_crushed () |
| void | try_remove_webs () |
| void | try_remove_impeding_effect () |
| bool | can_escape_trap (int difficulty, bool manip) const |
| bool | movement_mode_is (const move_mode_id &mode) const |
| Check against the character's current movement mode. More... | |
| move_mode_id | current_movement_mode () const |
| bool | is_running () const |
| bool | is_walking () const |
| bool | is_crouching () const |
| bool | is_prone () const |
| int | footstep_sound () const |
| int | clatter_sound () const |
| void | make_footstep_noise () const |
| void | make_clatter_sound () const |
| bool | can_switch_to (const move_mode_id &mode) const |
| steed_type | get_steed_type () const |
| int | get_instability_per_category (const mutation_category_id &categ) const |
| Generates an integer based on how many times we've gained non-negative mutations. More... | |
| void | expose_to_disease (const diseasetype_id &dis_type) |
| Determine if character is susceptible to dis_type and if so apply the symptoms. More... | |
| void | recalc_hp () |
| Recalculates HP after a change to max strength or enchantment. More... | |
| void | update_body_wetness (const w_point &weather) |
| Maintains body wetness and handles the rate at which the player dries. More... | |
| void | recalc_sight_limits () |
| Modifies the player's sight values Must be called when any of the following change: This must be called when any of the following change: More... | |
| float | get_vision_threshold (float light_level) const |
| Returns the apparent light level at which the player can see. More... | |
| void | flag_encumbrance () |
| Flag encumbrance for updating. More... | |
| void | check_item_encumbrance_flag () |
| Checks worn items for the "RESET_ENCUMBRANCE" flag, which indicates that encumbrance may have changed and require recalculating. More... | |
| bool | natural_attack_restricted_on (const bodypart_id &bp) const |
| Returns true if the character is wearing something on the entered body_part, ignoring items with the ALLOWS_NATURAL_ATTACKS flag. More... | |
| bool | natural_attack_restricted_on (const sub_bodypart_id &bp) const |
| bool | is_quiet () const |
| Returns true if the player has quiet melee attacks. More... | |
| bool | block_hit (Creature *source, bodypart_id &bp_hit, damage_instance &dam) override |
| Checks for valid block abilities and reduces damage accordingly. More... | |
| item_location | best_shield () |
| Returns the best item for blocking with. More... | |
| bool | handle_melee_wear (item_location shield, float wear_multiplier=1.0f) |
| Calculates melee weapon wear-and-tear through use, returns true if item is destroyed. More... | |
| matec_id | pick_technique (Creature &t, const item_location &weap, bool crit, bool dodge_counter, bool block_counter, const std::vector< matec_id > &blacklist={}) |
| Returns a random valid technique. More... | |
| std::vector< matec_id > | evaluate_techniques (Creature &t, const item_location &weap, bool crit=false, bool dodge_counter=false, bool block_counter=false, const std::vector< matec_id > &blacklist={}) |
| void | perform_technique (const ma_technique &technique, Creature &t, damage_instance &di, int &move_cost, item_location &cur_weapon) |
| damage_instance | modify_damage_dealt_with_enchantments (const damage_instance &dam) const override |
| bool | melee_attack (Creature &t, bool allow_special, const matec_id &force_technique, bool allow_unarmed=true, int forced_movecost=-1) |
| Sets up a melee attack and handles melee attack function calls. More... | |
| bool | melee_attack_abstract (Creature &t, bool allow_special, const matec_id &force_technique, bool allow_unarmed=true, int forced_movecost=-1) |
| void | reach_attack (const tripoint &p, int forced_movecost=-1) |
| Handles reach melee attacks. More... | |
| bool | melee_attack (Creature &t, bool allow_special) |
| Calls the to other melee_attack function with an empty technique id (meaning no specific technique should be used). More... | |
| std::string | melee_special_effects (Creature &t, damage_instance &d, item &weap) |
| Handles combat effects, returns a string of any valid combat effect messages. More... | |
| void | perform_special_attacks (Creature &t, dealt_damage_instance &dealt_dam) |
| Performs special attacks and their effects (poisonous, stinger, etc.) More... | |
| std::vector< special_attack > | mutation_attacks (Creature &t) const |
| Returns a vector of valid mutation attacks. More... | |
| float | bonus_damage (bool random) const |
| Returns the bonus bashing damage the player deals based on their stats. More... | |
| float | get_melee_hit_base () const |
| Returns weapon skill. More... | |
| float | hit_roll () const override |
| Returns the player's basic hit roll that is compared to the target's dodge roll. More... | |
| double | crit_chance (float roll_hit, float target_dodge, const item &weap) const |
| Returns the chance to critical given a hit roll and target's dodge roll. More... | |
| bool | scored_crit (float target_dodge, const item &weap) const |
| Returns true if the player scores a critical hit. More... | |
| int | attack_speed (const item &weap) const |
| Returns cost (in moves) of attacking with given item (no modifiers, like stuck) More... | |
| int | get_base_melee_stamina_cost (const item *weap=nullptr) const |
| Returns cost (in stamina) of attacking with given item, or wielded item if nullptr (no modifiers, worst possible is -50) More... | |
| int | get_total_melee_stamina_cost (const item *weap=nullptr) const |
| Returns total cost (in stamina) of attacking with given item, or wielded item if nullptr (modified by skill and walk/crouch/prone, worst possible is -50) More... | |
| float | get_hit_weapon (const item &weap) const |
| Gets melee accuracy component from weapon+skills. More... | |
| bool | can_attack_high () const override |
| Check if we can attack upper limbs. More... | |
| double | weapon_value (const item &weap, int ammo=10) const |
| NPC-related item rating functions. More... | |
| double | gun_value (const item &weap, int ammo=10) const |
| double | melee_value (const item &weap) const |
| double | unarmed_value () const |
| dispersion_sources | get_weapon_dispersion (const item &obj) const |
| Returns a weapon's modified dispersion value. More... | |
| void | roll_all_damage (bool crit, damage_instance &di, bool average, const item &weap, const std::string &attack_vector, const Creature *target, const bodypart_id &bp) const |
| Adds all 3 types of physical damage to instance. More... | |
| void | roll_damage (const damage_type_id &dt, bool crit, damage_instance &di, bool average, const item &weap, const std::string &attack_vector, float crit_mod) const |
| bool | is_dead_state () const override |
| Returns true if the player should be dead. More... | |
| void | set_part_hp_cur (const bodypart_id &id, int set) override |
| void | mod_part_hp_cur (const bodypart_id &id, int set) override |
| void | calc_all_parts_hp (float hp_mod=0.0, float hp_adjust=0.0, int str_max=0, int dex_max=0, int per_max=0, int int_max=0, int healthy_mod=0, int fat_to_max_hp=0) |
| bool | is_stealthy () const |
| Returns true if the player has stealthy movement. More... | |
| bool | can_melee () const |
| Returns true if the current martial art works with the player's current weapon. More... | |
| float | stability_roll () const override |
| Returns value of player's stable footing. More... | |
| bool | can_autolearn (const matype_id &ma_id) const |
| Returns true if the player can learn the entered martial art. More... | |
| bool | practice (const skill_id &id, int amount, int cap=99, bool suppress_warning=false) |
| This handles giving xp for a skill. More... | |
| void | handle_skill_warning (const skill_id &id, bool force_warning=false) |
| This handles warning the player that there current activity will not give them xp. More... | |
| ret_val< void > | can_wield (const item &it) const |
| Check player capable of wielding an item. More... | |
| bool | unwield () |
| std::string | weapname () const |
| Get the formatted name of the currently wielded item (if any) with current gun mode (if gun) More... | |
| std::string | weapname_simple () const |
| Get the formatted name of the currently wielded item (if any) without current gun mode and ammo. More... | |
| std::string | weapname_mode () const |
| Get the formatted current gun mode (if gun) More... | |
| std::string | weapname_ammo () const |
| Get the formatted current ammo (if gun) More... | |
| void | on_hit (Creature *source, bodypart_id bp_hit, float difficulty=INT_MIN, dealt_projectile_attack const *proj=nullptr) override |
| Handles special defenses from melee attack that hit us (source can be null) More... | |
| void | did_hit (Creature &target) |
| void | apply_damage (Creature *source, bodypart_id hurt, int dam, bool bypass_med=false) override |
| Actually hurt the player, hurts a body_part directly, no armor reduction. More... | |
| dealt_damage_instance | deal_damage (Creature *source, bodypart_id bp, const damage_instance &d, const weakpoint_attack &attack=weakpoint_attack()) override |
| Calls Creature::deal_damage and handles damaged effects (waking up, etc.) More... | |
| int | reduce_healing_effect (const efftype_id &eff_id, int remove_med, const bodypart_id &hurt) |
| Reduce healing effect intensity, return initial intensity of the effect. More... | |
| void | cough (bool harmful=false, int loudness=4) |
| void | passive_absorb_hit (const bodypart_id &bp, damage_unit &du) const |
| Check for relevant passive, non-clothing that can absorb damage, and reduce by specified damage unit. More... | |
| const weakpoint * | absorb_hit (const weakpoint_attack &attack, const bodypart_id &bp, damage_instance &dam) override |
| Runs through all bionics and armor on a part and reduces damage through their armor_absorb. More... | |
| float | melee_weakpoint_skill (const item &weapon) const |
| The character's skill in hitting a weakpoint. More... | |
| float | ranged_weakpoint_skill (const item &weapon) const |
| float | throw_weakpoint_skill () const |
| bool | armor_absorb (damage_unit &du, item &armor, const bodypart_id &bp, int roll) const |
| Reduces and mutates du, prints messages about armor taking damage. More... | |
| bool | armor_absorb (damage_unit &du, item &armor, const bodypart_id &bp, const sub_bodypart_id &sbp, int roll) const |
| Reduces and mutates du, prints messages about armor taking damage. More... | |
| bool | ablative_armor_absorb (damage_unit &du, item &armor, const sub_bodypart_id &bp, int roll) |
| Reduces and mutates du, prints messages about armor taking damage. More... | |
| void | describe_damage (damage_unit &du, item &armor) const |
| float | bionic_armor_bonus (const bodypart_id &bp, const damage_type_id &dt) const |
| Check for passive bionics that provide armor, and returns the armor bonus This is called from player::passive_absorb_hit. More... | |
| int | mabuff_armor_bonus (const damage_type_id &type) const |
| Returns the armor bonus against given type from martial arts buffs. More... | |
| trait_id | random_good_trait () |
| Returns the id of a random starting trait that costs >= 0 points. More... | |
| trait_id | random_bad_trait () |
| Returns the id of a random starting trait that costs < 0 points. More... | |
| trait_id | get_random_trait (const std::function< bool(const mutation_branch &)> &func) |
| Returns the id of a random trait matching the given predicate. More... | |
| void | randomize_cosmetic_trait (const std::string &mutation_type) |
| bool | has_conflicting_trait (const trait_id &flag) const |
| Returns true if the player has a conflicting trait to the entered trait Uses has_opposite_trait(), has_lower_trait(), and has_higher_trait() to determine conflicts. More... | |
| std::unordered_set< trait_id > | get_conflicting_traits (const trait_id &flag) const |
| Returns all player's traits conflicting with the entered trait. More... | |
| bool | has_lower_trait (const trait_id &flag) const |
| Returns true if the player has a trait which upgrades into the entered trait. More... | |
| std::unordered_set< trait_id > | get_lower_traits (const trait_id &flag) const |
| Returns player's traits which upgrade into the entered trait. More... | |
| bool | has_replacement_trait (const trait_id &flag) const |
| Returns true if the player has a trait which is a replacement of the entered trait. More... | |
| std::unordered_set< trait_id > | get_replacement_traits (const trait_id &flag) const |
| Returns player's traits which replace the entered trait. More... | |
| bool | has_addition_trait (const trait_id &flag) const |
| Returns true if the player has a trait which adds to the entered trait. More... | |
| std::unordered_set< trait_id > | get_addition_traits (const trait_id &flag) const |
| Returns player's traits which add to the entered trait. More... | |
| bool | has_same_type_trait (const trait_id &flag) const |
| Returns true if the player has a trait that shares a type with the entered trait. More... | |
| std::unordered_set< trait_id > | get_same_type_traits (const trait_id &flag) const |
| Returns player's traits that share a type with the entered trait. More... | |
| bool | purifiable (const trait_id &flag) const |
| Returns true if the entered trait may be purified away Defaults to true. More... | |
| std::string | get_category_dream (const mutation_category_id &cat, int strength) const |
| Returns a dream's description selected randomly from the player's highest mutation category. More... | |
| bool | has_trait (const trait_id &b) const override |
| Returns true if the player has the entered trait. More... | |
| bool | has_trait_variant (const trait_and_var &) const |
| Returns true if the player has the entered trait with the desired variant. More... | |
| bool | has_base_trait (const trait_id &b) const |
| Returns true if the player has the entered starting trait. More... | |
| bool | has_trait_flag (const json_character_flag &b) const |
| Returns true if player has a trait with a flag. More... | |
| bool | has_bionic_with_flag (const json_character_flag &flag) const |
| Returns true if player has a bionic with a flag. More... | |
| bool | has_bodypart_with_flag (const json_character_flag &flag) const |
| Returns true if the player has any bodypart with a flag. More... | |
| int | count_trait_flag (const json_character_flag &b) const |
| Returns count of traits with a flag. More... | |
| int | count_bionic_with_flag (const json_character_flag &flag) const |
| Returns count of bionics with a flag. More... | |
| int | count_bodypart_with_flag (const json_character_flag &flag) const |
| Returns count of bodyparts with a flag. More... | |
| bool | has_flag (const json_character_flag &flag) const |
| Returns true if player has a trait, bionic, effect, bodypart, or martial arts buff with a flag. More... | |
| int | count_flag (const json_character_flag &flag) const |
| Returns the count of traits, bionics, effects, bodyparts, and martial arts buffs with a flag. More... | |
| trait_id | trait_by_invlet (int ch) const |
| Returns the trait id with the given invlet, or an empty string if no trait has that invlet. More... | |
| void | toggle_trait (const trait_id &, const std::string &="") |
| Toggles a trait on the player and in their mutation list. More... | |
| void | set_mutations (const std::vector< trait_id > &traits) |
| Add or removes a mutation on the player, but does not trigger mutation loss/gain effects. More... | |
| void | set_mutation (const trait_id &, const mutation_variant *=nullptr) |
| void | set_mut_variant (const trait_id &, const mutation_variant *) |
| Switches the variant of the given mutation, if the player has that mutation. More... | |
| void | do_mutation_updates () |
| void | unset_mutation (const trait_id &) |
| void | switch_mutations (const trait_id &switched, const trait_id &target, bool start_powered, bool safe=false) |
| Unset switched mutation and set target mutation instead, if safe mutates towards the target mutation. More... | |
| bool | can_power_mutation (const trait_id &mut) const |
| virtual void | power_bionics () |
| Generates and handles the UI for player interaction with installed bionics. More... | |
| bool | can_interface_armor () const |
| Check whether player has a bionic power armor interface. More... | |
| virtual void | power_mutations () |
| void | mutation_reflex_trigger (const trait_id &mut) |
| Trigger reflex activation if the mutation has one. More... | |
| void | activate_mutation (const trait_id &mutation) |
| void | deactivate_mutation (const trait_id &mut) |
| bool | can_mount (const monster &critter) const |
| void | mount_creature (monster &z) |
| bool | cant_do_mounted (bool msg=true) const |
| bool | is_mounted () const |
| bool | check_mount_will_move (const tripoint &dest_loc) |
| bool | check_mount_is_spooked () |
| void | dismount () |
| void | forced_dismount () |
| bool | move_in_vehicle (Creature *c, const tripoint &dest_loc) const |
| Attempt to enter a tile in a vehicle. More... | |
| bool | is_deaf () const |
| bool | is_mute () const |
| float | get_limb_score (const limb_score_id &score, const body_part_type::type &bp=body_part_type::type::num_types, int override_encumb=-1, int override_wounds=-1) const |
| float | manipulator_score (const std::map< bodypart_str_id, bodypart > &body, body_part_type::type type, int override_encumb, int override_wounds) const |
| bool | has_min_manipulators () const |
| bool | has_two_arms_lifting () const |
| Returns true if the character has two functioning arms. More... | |
| std::set< matec_id > | get_limb_techs () const |
| int | get_working_arm_count () const |
| bool | enough_working_legs () const |
| Returns true if enough of your legs are working Currently requires all, new morphologies could be different. More... | |
| int | get_working_leg_count () const |
| Returns the number of functioning legs. More... | |
| bool | is_limb_broken (const bodypart_id &limb) const |
| Returns true if the limb is broken. More... | |
| bool | can_run () const |
| source of truth of whether a Character can run More... | |
| void | hurtall (int dam, Creature *source, bool disturb=true) |
| Hurts all body parts for dam, no armor reduction. More... | |
| int | hitall (int dam, int vary, Creature *source) |
| Harms all body parts for dam, with armor reduction. More... | |
| void | on_hurt (Creature *source, bool disturb=true) |
| Handles effects that happen when the player is damaged and aware of the fact. More... | |
| void | heal_bp (bodypart_id bp, int dam) override |
| Heals a body_part for dam. More... | |
| void | heal (const bodypart_id &healed, int dam) |
| Heals an part for dam. More... | |
| void | healall (int dam) |
| Heals all body parts for dam. More... | |
| std::vector< skill_id > | skills_offered_to (const Character *you) const |
| std::vector< proficiency_id > | proficiencies_offered_to (const Character *guy) const |
| Proficiencies we know that the character doesn't. More... | |
| std::vector< matype_id > | styles_offered_to (const Character *you) const |
| Martial art styles that we known, but the player p doesn't. More... | |
| std::vector< spell_id > | spells_offered_to (const Character *you) const |
| Spells that the NPC knows but that the player p doesn't. More... | |
| int | calc_spell_training_cost (bool knows, int difficulty, int level) const |
| void | migrate_items_to_storage (bool disintegrate) |
| used for profession spawning and save migration for nested containers. More... | |
| bodypart_id | body_window (const std::string &menu_header, bool show_all, bool precise, int normal_bonus, int head_bonus, int torso_bonus, int bleed, float bite, float infect, float bandage_power, float disinfectant_power) const |
| Displays menu with body part hp, optionally with hp estimation after healing. More... | |
| bool | made_of (const material_id &m) const override |
| bool | made_of_any (const std::set< material_id > &ms) const override |
| void | calc_encumbrance () |
| Recalculate encumbrance for all body parts. More... | |
| void | calc_discomfort () |
| Calculate any discomfort your current clothes are causing. More... | |
| void | calc_encumbrance (const item &new_item) |
Recalculate encumbrance for all body parts as if new_item was also worn. More... | |
| void | recalculate_bodyparts () |
| void | recalculate_enchantment_cache () |
| double | calculate_by_enchantment (double modify, enchant_vals::mod value, bool round_output=false) const |
| bool | has_mabuff (const mabuff_id &buff_id) const |
| Returns true if the player has any martial arts buffs attached. More... | |
| bool | has_grab_break_tec () const override |
| Returns true if the player has a grab breaking technique available. More... | |
| float | mabuff_tohit_bonus () const |
| Returns the to hit bonus from martial arts buffs. More... | |
| float | mabuff_critical_hit_chance_bonus () const |
| Returns the critical hit chance bonus from martial arts buffs. More... | |
| float | mabuff_dodge_bonus () const |
| Returns the dodge bonus from martial arts buffs. More... | |
| int | mabuff_block_effectiveness_bonus () const |
| Returns the blocking effectiveness bonus from martial arts buffs. More... | |
| int | mabuff_block_bonus () const |
| Returns the block bonus from martial arts buffs. More... | |
| int | mabuff_speed_bonus () const |
| Returns the speed bonus from martial arts buffs. More... | |
| int | mabuff_arpen_bonus (const damage_type_id &type) const |
| Returns the arpen bonus from martial arts buffs. More... | |
| float | mabuff_damage_mult (const damage_type_id &type) const |
| Returns the damage multiplier to given type from martial arts buffs. More... | |
| int | mabuff_damage_bonus (const damage_type_id &type) const |
| Returns the flat damage bonus to given type from martial arts buffs, applied after the multiplier. More... | |
| int | mabuff_attack_cost_penalty () const |
| Returns the flat penalty to move cost of attacks. More... | |
| float | mabuff_attack_cost_mult () const |
| Returns the multiplier on move cost of attacks. More... | |
| bool | has_mabuff_flag (const json_character_flag &flag) const |
| Returns true if player has a MA buff with a flag. More... | |
| int | count_mabuff_flag (const json_character_flag &flag) const |
| void | mutation_effect (const trait_id &mut, bool worn_destroyed_override) |
| Handles things like destruction of armor, etc. More... | |
| void | mutation_loss_effect (const trait_id &mut) |
| Handles what happens when you lose a mutation. More... | |
| bool | has_active_mutation (const trait_id &b) const |
| time_duration | get_cost_timer (const trait_id &mut_id) const |
| void | set_cost_timer (const trait_id &mut, time_duration set) |
| void | mod_cost_timer (const trait_id &mut, time_duration mod) |
| void | mutate (const int &true_random_chance, bool use_vitamins) |
| Picks a random valid mutation and gives it to the Character, possibly removing/changing others along the way. More... | |
| void | mutate () |
| bool | mutation_ok (const trait_id &mutation, bool allow_good, bool allow_bad, bool allow_neutral, const vitamin_id &mut_vit) const |
| Returns true if the player doesn't have the mutation or a conflicting one and it complies with the allowed typing. More... | |
| bool | mutation_ok (const trait_id &mutation, bool allow_good, bool allow_bad, bool allow_neutral) const |
| bool | roll_bad_mutation (const mutation_category_id &categ) const |
| Roll, based on category and total mutations in/out of it, whether next mutation should be good or bad. More... | |
| bool | mutation_selector (const std::vector< trait_id > &prospective_traits, const mutation_category_id &cat, const bool &use_vitamins) |
| Opens a menu which allows players to choose from a list of mutations. More... | |
| void | mutate_category (const mutation_category_id &mut_cat, bool use_vitamins, bool true_random=false) |
| Picks a random valid mutation in a category and mutate_towards() it. More... | |
| void | mutate_category (const mutation_category_id &mut_cat) |
| bool | mutate_towards (std::vector< trait_id > muts, const mutation_category_id &mut_cat, int num_tries=INT_MAX, bool use_vitamins=true, bool removed_base_trait=false) |
| Mutates toward one of the given mutations, upgrading or removing conflicts if necessary. More... | |
| bool | mutate_towards (const trait_id &mut, const mutation_category_id &mut_cat, const mutation_variant *chosen_var=nullptr, bool use_vitamins=true, bool removed_base_trait=false) |
| Mutates toward the entered mutation, upgrading or removing conflicts if necessary. More... | |
| bool | mutate_towards (const trait_id &mut, const mutation_variant *chosen_var=nullptr) |
| void | remove_mutation (const trait_id &mut, bool silent=false) |
| Removes a mutation, downgrading to the previous level if possible. More... | |
| bool | has_child_flag (const trait_id &flag) const |
| Returns true if the player has the entered mutation child flag. More... | |
| void | remove_child_flag (const trait_id &flag) |
| Removes the mutation's child flag from the player's list. More... | |
| void | test_crossing_threshold (const mutation_category_id &mutation_category) |
| Try to cross The Threshold. More... | |
| int | mutation_height (const trait_id &mut) const |
| Returns how many steps are required to reach a mutation. More... | |
| void | calc_mutation_levels () |
| Recalculates mutation_category_level[] values for the player. More... | |
| weighted_int_list< mutation_category_id > | get_vitamin_weighted_categories () const |
| Returns a weighted list of mutation categories based on blood vitamin levels. More... | |
| void | drench_mut_calc () |
| Recalculates mutation drench protection for all bodyparts (ignored/good/neutral stats) More... | |
| bool | is_category_allowed (const std::vector< mutation_category_id > &category) const |
| Returns true if this category of mutation is allowed. More... | |
| bool | is_category_allowed (const mutation_category_id &category) const |
| bool | can_use_heal_item (const item &med) const |
| Check for mutation disallowing the use of an healing item. More... | |
| bool | can_install_cbm_on_bp (const std::vector< bodypart_id > &bps) const |
| resistances | mutation_armor (bodypart_id bp) const |
| Returns resistances on a body part provided by mutations. More... | |
| float | mutation_armor (bodypart_id bp, const damage_type_id &dt) const |
| float | mutation_armor (bodypart_id bp, const damage_unit &du) const |
| void | give_all_mutations (const mutation_category_trait &category, bool include_postthresh=false) |
| gives every mutation in a category, optionally including post-thresh mutations More... | |
| void | unset_all_mutations () |
| unsets all mutations More... | |
| bool | activate_bionic (bionic &bio, bool eff_only=false, bool *close_bionics_ui=nullptr) |
| Handles bionic activation effects of the entered bionic, returns if anything activated. More... | |
| std::vector< bionic_id > | get_bionics () const |
| std::vector< const item * > | get_pseudo_items () const |
| void | invalidate_pseudo_items () |
| void | update_last_bionic_uid () const |
| Finds the highest UID for installed bionics and caches the next valid UID. More... | |
| bionic_uid | generate_bionic_uid () const |
| Returns the next valid UID for a bionic installation. More... | |
| bool | has_bionic (const bionic_id &b) const |
| Returns true if the player has the entered bionic id. More... | |
| bool | has_active_bionic (const bionic_id &b) const |
| Returns true if the player has the entered bionic id and it is powered on. More... | |
| bool | has_any_bionic () const |
| Returns true if the player has any bionic. More... | |
| std::vector< bionic_id > | get_bionic_fueled_with_muscle () const |
| Return bionic_id of bionics able to use it as fuel. More... | |
| std::vector< bionic_id > | get_fueled_bionics () const |
| Return bionic_id of fueled bionics. More... | |
| bionic_id | get_remote_fueled_bionic () const |
| Returns bionic_id of first remote fueled bionic found. More... | |
| std::vector< item * > | get_bionic_fuels (const bionic_id &bio) |
| Return list of available fuel sources that are not empty for this bionic. More... | |
| std::vector< item * > | get_cable_ups () |
| Returns not-empty UPS connected to cable charger bionic. More... | |
| std::vector< item * > | get_cable_solar () |
| Returns solar items connected to cable charger bionic. More... | |
| std::vector< vehicle * > | get_cable_vehicle () const |
| Returns vehicles connected to cable charger bionic. More... | |
| bool | is_using_bionic_weapon () const |
| bionic_uid | get_weapon_bionic_uid () const |
| void | process_bionic (bionic &bio) |
| Handles bionic effects over time of the entered bionic. More... | |
| ret_val< void > | can_deactivate_bionic (bionic &bio, bool eff_only=false) const |
| Checks if bionic can be deactivated (e.g. More... | |
| bool | deactivate_bionic (bionic &bio, bool eff_only=false) |
| Handles bionic deactivation effects of the entered bionic, returns if anything deactivated. More... | |
| void | force_bionic_deactivation (bionic &bio) |
| int | num_bionics () const |
| Returns the size of my_bionics[]. More... | |
| bionic & | bionic_at_index (int i) |
| Returns the bionic at a given index in my_bionics[]. More... | |
| void | clear_bionics () |
| Remove all bionics. More... | |
| int | get_used_bionics_slots (const bodypart_id &bp) const |
| int | get_total_bionics_slots (const bodypart_id &bp) const |
| int | get_free_bionics_slots (const bodypart_id &bp) const |
| bool | has_enough_anesth (const itype &cbm, Character &patient) const |
| Has enough anesthetic for surgery. More... | |
| bool | has_enough_anesth (const itype &cbm) const |
| void | consume_anesth_requirement (const itype &cbm, Character &patient) |
| bool | has_installation_requirement (const bionic_id &bid) const |
| Has the required equipment for manual installation. More... | |
| void | consume_installation_requirement (const bionic_id &bid) |
| void | introduce_into_anesthesia (const time_duration &duration, Character &installer, bool needs_anesthesia) |
| Handles process of introducing patient into anesthesia during Autodoc operations. More... | |
| std::optional< bionic * > | find_bionic_by_type (const bionic_id &b) const |
| Finds the first bionic instance that matches the bionic_id. More... | |
| std::optional< bionic * > | find_bionic_by_uid (bionic_uid bio_uid) const |
| Finds the bionic with specified UID. More... | |
| void | remove_bionic (const bionic &bio) |
| Removes a bionic from my_bionics[]. More... | |
| bionic_uid | add_bionic (const bionic_id &b, bionic_uid parent_uid=0, bool suppress_debug=false) |
| Adds a bionic to my_bionics[]. More... | |
| float | env_surgery_bonus (int radius) const |
| Calculate skill bonus from tiles in radius. More... | |
| float | bionics_adjusted_skill (bool autodoc, int skill_level=-1) const |
| Calculate skill for (un)installing bionics. More... | |
| int | bionics_pl_skill (bool autodoc, int skill_level=-1) const |
| Calculate non adjusted skill for (un)installing bionics. More... | |
| bool | can_install_bionics (const itype &type, Character &installer, bool autodoc=false, int skill_level=-1) const |
| Is the installation possible. More... | |
| ret_val< void > | is_installable (const item *it, bool by_autodoc) const |
| Is this bionic elligible to be installed in the player? More... | |
| std::map< bodypart_id, int > | bionic_installation_issues (const bionic_id &bioid) const |
| bool | install_bionics (const itype &type, Character &installer, bool autodoc=false, int skill_level=-1) |
| Initialize all the values needed to start the operation player_activity. More... | |
| void | perform_install (const bionic_id &bid, bionic_uid upbio_uid, int difficulty, int success, int pl_skill, const std::string &installer_name, const std::vector< trait_id > &trait_to_rem, const tripoint &patient_pos) |
| Success or failure of installation happens here. More... | |
| void | bionics_install_failure (const bionic_id &bid, const std::string &installer, int difficulty, int success, float adjusted_skill, const tripoint &patient_pos) |
| bool | wield_contents (item &container, item *internal_item=nullptr, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY) |
| Try to wield a contained item consuming moves proportional to weapon skill and volume. More... | |
| void | use (int inventory_position) |
| Uses a tool. More... | |
| void | use (item_location loc, int pre_obtain_moves=-1, std::string const &method={}) |
| Uses a tool at location. More... | |
| void | use_wielded () |
| Uses the current wielded weapon. More... | |
| std::optional< std::list< item >::iterator > | wear (int pos, bool interactive=true) |
| Wear item; returns false on fail. More... | |
| std::optional< std::list< item >::iterator > | wear (item_location item_wear, bool interactive=true) |
| Wear item; returns false on fail. More... | |
| trinary | consume (item_location loc, bool force=false) |
| Used for eating object at a location. More... | |
| trinary | consume (item &target, bool force=false) |
| Used for eating a particular item that doesn't need to be in inventory. More... | |
| void | store (item &container, item &put, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY, pocket_type pk_type=pocket_type::CONTAINER, bool check_best_pkt=false) |
| Stores an item inside another consuming moves proportional to weapon skill and volume. More... | |
| void | store (item_pocket *pocket, item &put, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY) |
| bool | can_uninstall_bionic (const bionic &bio, Character &installer, bool autodoc=false, int skill_level=-1) const |
| Is The uninstallation possible. More... | |
| bool | uninstall_bionic (const bionic &bio, Character &installer, bool autodoc=false, int skill_level=-1) |
| Initialize all the values needed to start the operation player_activity. More... | |
| void | perform_uninstall (const bionic &bio, int difficulty, int success, int pl_skill) |
| Success or failure of removal happens here. More... | |
| void | bionics_uninstall_failure (int difficulty, int success, float adjusted_skill) |
| When a player fails the surgery. More... | |
| void | roll_critical_bionics_failure (const bodypart_id &bp) |
| When a critical failure occurs. More... | |
| bool | uninstall_bionic (const bionic &bio, monster &installer, Character &patient, float adjusted_skill) |
| Used by monster to perform surgery. More... | |
| void | bionics_uninstall_failure (monster &installer, Character &patient, int difficulty, int success, float adjusted_skill) |
| When a monster fails the surgery. More... | |
| void | on_worn_item_transform (const item &old_it, const item &new_it) |
| bool | gunmod_remove (item &gun, item &mod) |
| Starts activity to remove gunmod after unloading any contained ammo. More... | |
| void | gunmod_add (item &gun, item &mod) |
| Starts activity to install gunmod having warned user about any risk of failure or irremovable mods s. More... | |
| void | toolmod_add (item_location tool, item_location mod) |
| Starts activity to install toolmod. More... | |
| void | mend_item (item_location &&obj, bool interactive=true) |
| Attempt to mend an item (fix any current faults) More... | |
| bool | list_ammo (const item_location &base, std::vector< item::reload_option > &ammo_list, bool empty=true) const |
| void | process_items () |
| void | leak_items () |
| void | search_surroundings () |
| Search surrounding squares for traps (and maybe other things in the future). More... | |
| void | heat_emission (const bionic &bio, units::energy fuel_energy) |
| Handle heat from exothermic power generation. More... | |
| float | get_effective_efficiency (const bionic &bio, float fuel_efficiency) const |
| Applies modifier to fuel_efficiency and returns the resulting efficiency. More... | |
| units::energy | get_power_level () const |
| units::energy | get_max_power_level () const |
| void | mod_power_level (const units::energy &npower) |
| void | mod_max_power_level_modifier (const units::energy &npower_max) |
| void | set_power_level (const units::energy &npower) |
| void | set_max_power_level (const units::energy &capacity) |
| void | set_max_power_level_modifier (const units::energy &capacity) |
| void | update_bionic_power_capacity () |
| bool | is_max_power () const |
| bool | has_power () const |
| bool | has_max_power () const |
| bool | enough_power_for (const bionic_id &bid) const |
| void | disp_info (bool customize_character=false) |
| Handles and displays detailed character info for the '@' screen. More... | |
| void | conduct_blood_analysis () |
| bool | is_worn (const item &thing) const |
| bool | is_worn_module (const item &thing) const |
| virtual bool | invoke_item (item *, const std::string &, const tripoint &pt, int pre_obtain_moves=-1) |
| As above, but with a pre-selected method. More... | |
| bool | consume_charges (item &used, int qty) |
| Consume charges of a tool or comestible item, potentially destroying it in the process. More... | |
| item | reduce_charges (item *it, int quantity) |
| Remove charges from a specific item. More... | |
| int | item_handling_cost (const item &it, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY, int charges_in_it=-1, bool bulk_cost=false) const |
| Calculate (but do not deduct) the number of moves required when handling (e.g. More... | |
| int | item_store_cost (const item &it, const item &container, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY) const |
| Calculate (but do not deduct) the number of moves required when storing an item in a container. More... | |
| int | item_retrieve_cost (const item &it, const item &container, bool penalties=true, int base_cost=INVENTORY_HANDLING_PENALTY) const |
| Calculate (but do not deduct) the number of moves required when drawing a weapon from an holster or sheathe. More... | |
| int | item_wear_cost (const item &it) const |
| Calculate (but do not deduct) the number of moves required to wear an item. More... | |
| std::optional< std::list< item >::iterator > | wear_item (const item &to_wear, bool interactive=true, bool do_calc_encumbrance=true) |
| Wear item; returns nullopt on fail, or pointer to newly worn item on success. More... | |
| int | amount_worn (const itype_id &id) const |
| Returns the amount of item ‘type’ that is currently worn. More... | |
| int | count_softwares (const itype_id &id) |
| Returns the amount of software ‘type’ that are in the inventory. More... | |
| std::vector< item_location > | nearby (const std::function< bool(const item *, const item *)> &func, int radius=1) const |
| Returns nearby items which match the provided predicate. More... | |
| std::list< item > | remove_worn_items_with (const std::function< bool(item &)> &filter) |
| Similar to remove_items_with, but considers only worn items and not their content (item::contents is not checked). More... | |
| void | clear_worn () |
| std::vector< item_location > | all_items_loc () |
| std::vector< item_location > | top_items_loc () |
| item * | invlet_to_item (int invlet) const |
| Return the item pointer of the item with given invlet, return nullptr if the player does not have such an item with that invlet. More... | |
| item & | i_at (int position) |
| const item & | i_at (int position) const |
| int | get_item_position (const item *it) const |
| Returns the item position (suitable for i_at or similar) of a specific item. More... | |
| item_location | used_weapon () const |
| Returns a reference to the item which will be used to make attacks. More... | |
| item_location | used_weapon () |
| item_location | i_add (item it, bool should_stack=true, const item *avoid=nullptr, const item *original_inventory_item=nullptr, bool allow_drop=true, bool allow_wield=true, bool ignore_pkt_settings=false) |
| Adds the item to the character's worn items or wields it, or prompts if the Character cannot pick it up. More... | |
| item_location | i_add (item it, int &copies_remaining, bool should_stack=true, const item *avoid=nullptr, const item *original_inventory_item=nullptr, bool allow_drop=true, bool allow_wield=true, bool ignore_pkt_settings=false) |
| item_location | try_add (item it, const item *avoid=nullptr, const item *original_inventory_item=nullptr, bool allow_wield=true, bool ignore_pkt_settings=false) |
| tries to add to the character's inventory without a popup. More... | |
| item_location | try_add (item it, int &copies_remaining, const item *avoid=nullptr, const item *original_inventory_item=nullptr, bool allow_wield=true, bool ignore_pkt_settings=false) |
| ret_val< item_location > | i_add_or_fill (item &it, bool should_stack=true, const item *avoid=nullptr, const item *original_inventory_item=nullptr, bool allow_drop=true, bool allow_wield=true, bool ignore_pkt_settings=false) |
| item | i_rem (const item *it) |
| Remove a specific item from player possession. More... | |
| void | i_rem_keep_contents (const item *it) |
| bool | i_add_or_drop (item &it, int qty=1, const item *avoid=nullptr, const item *original_inventory_item=nullptr) |
| Sets invlet and adds to inventory if possible, drops otherwise, returns true if either succeeded. More... | |
| bool | i_drop_at (item &it, int qty=1) |
| Drops items at player location An optional qty can be provided (and will perform better than separate calls). More... | |
| void | handle_contents_changed (const std::vector< item_location > &containers) |
Check any already unsealed pockets in items pointed to by containers and propagate the unsealed status through the container tree. More... | |
| std::bitset< std::numeric_limits< char >::max()> | allocated_invlets () const |
| Only use for UI things. More... | |
| bool | has_active_item (const itype_id &id) const |
| Whether the player carries an active item of the given item type. More... | |
| item | remove_weapon () |
| void | remove_mission_items (int mission_id) |
| std::vector< const item * > | get_ammo (const ammotype &at) const |
| Returns the items that are ammo and have the matching ammo type. More... | |
| std::vector< item_location > | find_ammo (const item &obj, bool empty=true, int radius=1) const |
| Searches for ammo or magazines that can be used to reload obj. More... | |
| std::vector< item_location > | find_reloadables () |
| Searches for weapons and magazines that can be reloaded. More... | |
| int | ammo_count_for (const item_location &gun) const |
| Counts ammo and UPS charges (lower of) for a given gun on the character. More... | |
| bool | can_reload (const item &it, const item *ammo=nullptr) const |
| Whether a tool or gun is potentially reloadable (optionally considering a specific ammo) More... | |
| hint_rating | rate_action_reload (const item &it) const |
Same as Character::can_reload, but checks for attached gunmods as well. More... | |
| hint_rating | rate_action_unload (const item &it) const |
| Whether a tool or a gun can be unloaded. More... | |
| hint_rating | rate_action_insert (const item_location &loc) const |
| bool | add_or_drop_with_msg (item &it, bool unloading=false, const item *avoid=nullptr, const item *original_inventory_item=nullptr) |
| So far only called by unload() from game.cpp @avoid - do not put @it into @avoid @original_inventory_item set if the item was already in the characters inventory (wielded, worn, in different pocket) and is being moved. More... | |
| bool | unload (item_location &loc, bool bypass_activity=false, const item_location &new_container=item_location::nowhere) |
| Unload item. More... | |
| int | item_reload_cost (const item &it, const item &ammo, int qty) const |
| Calculate (but do not deduct) the number of moves required to reload an item with specified quantity of ammo. More... | |
| projectile | thrown_item_projectile (const item &thrown) const |
| int | thrown_item_adjusted_damage (const item &thrown) const |
| int | thrown_item_total_damage_raw (const item &thrown) const |
| int | throw_range (const item &) const |
| Maximum thrown range with a given item, taking all active effects into account. More... | |
| int | throwing_dispersion (const item &to_throw, Creature *critter=nullptr, bool is_blind_throw=false) const |
| Dispersion of a thrown item, against a given target, taking into account whether or not the throw was blind. More... | |
| int | throw_dispersion_per_dodge (bool add_encumbrance=true) const |
| How much dispersion does one point of target's dodge add when throwing at said target? More... | |
| bool | unarmed_attack () const |
| True if unarmed. More... | |
| units::mass | best_nearby_lifting_assist () const |
| Checks for items, tools, and vehicles with the Lifting quality near the character returning the largest weight liftable by an item in range. More... | |
| units::mass | best_nearby_lifting_assist (const tripoint &world_pos) const |
| Alternate version if you need to specify a different origin point for nearby vehicle sources of lifting used for operations on distant objects (e.g. More... | |
| std::vector< item * > | inv_dump () |
| std::vector< const item * > | inv_dump () const |
| units::mass | weight_carried () const |
| units::volume | volume_carried () const |
| units::length | max_single_item_length () const |
| units::volume | max_single_item_volume () const |
| units::mass | weight_carried_with_tweaks (const item_tweaks &tweaks) const |
| units::mass | weight_carried_with_tweaks (const std::vector< std::pair< item_location, int >> &locations) const |
| units::volume | volume_carried_with_tweaks (const item_tweaks &tweaks) const |
| units::volume | volume_carried_with_tweaks (const std::vector< std::pair< item_location, int >> &locations) const |
| units::mass | weight_capacity () const override |
| units::volume | volume_capacity () const |
| units::volume | volume_capacity_with_tweaks (const item_tweaks &tweaks) const |
| units::volume | volume_capacity_with_tweaks (const std::vector< std::pair< item_location, int >> &locations) const |
| units::volume | free_space () const |
| units::mass | free_weight_capacity () const |
| units::volume | holster_volume () const |
| Returns the total volume of all worn holsters. More... | |
| int | used_holsters () const |
| Used and total holsters. More... | |
| int | total_holsters () const |
| units::volume | free_holster_volume () const |
| int | empty_holsters () const |
| units::volume | small_pocket_volume (const units::volume &threshold=1000_ml) const |
| Returns the total volume of all pockets less than or equal to the volume passed in. More... | |
| book_mastery | get_book_mastery (const item &book) const |
| bool | fun_to_read (const item &book) const |
| Calculates the total fun bonus relative to this character's traits and chapter progress. More... | |
| int | book_fun_for (const item &book, const Character &p) const |
| bool | can_pickVolume (const item &it, bool safe=false, const item *avoid=nullptr, bool ignore_pkt_settings=true) const |
| bool | can_pickVolume_partial (const item &it, bool safe=false, const item *avoid=nullptr, bool ignore_pkt_settings=true, bool is_pick_up_inv=false) const |
| bool | can_pickWeight (const item &it, bool safe=true) const |
| bool | can_pickWeight_partial (const item &it, bool safe=true) const |
| std::pair< item_location, item_pocket * > | best_pocket (const item &it, const item *avoid=nullptr, bool ignore_settings=false) |
| What is the best pocket to put @it into? More... | |
| std::vector< pocket_data_with_parent > | get_all_pocket_with_parent (const std::function< bool(const item_pocket *)> &filter=return_true< const item_pocket * >, const std::function< bool(const pocket_data_with_parent &a, const pocket_data_with_parent &b)> *sort_func=nullptr) |
| Collect all pocket data (with parent and nest levels added) that the character has. More... | |
| bool | can_use (const item &it, const item &context=item()) const |
| Checks if character stats and skills meet minimum requirements for the item. More... | |
| ret_val< void > | can_wear (const item &it, bool with_equip_change=false) const |
| Check character capable of wearing an item. More... | |
| bool | is_armed () const |
| Returns true if the character is wielding something. More... | |
| bool | has_wield_conflicts (const item &it) const |
| Returns true if the character is wielding something and it can't be combined with the item passed as a parameter. More... | |
| ret_val< void > | can_unwield (const item &it) const |
| Check player capable of unwielding an item. More... | |
| ret_val< void > | can_drop (const item &it) const |
| Check player capable of dropping an item. More... | |
| void | clear_inventory_search_cache () |
| void | drop_invalid_inventory () |
| void | invalidate_inventory_validity_cache () |
| void | invalidate_weight_carried_cache () |
| std::list< item * > | get_dependent_worn_items (const item &it) |
| Returns all items that must be taken off before taking off this item. More... | |
| void | drop (item_location loc, const tripoint &where) |
| Drops an item to the specified location. More... | |
| void | pick_up (const drop_locations &what) |
| Assigns character activity to pick up items from the given drop_locations. More... | |
| bool | is_wielding (const item &target) const |
| bool | covered_with_flag (const flag_id &flag, const body_part_set &parts) const |
| bool | is_waterproof (const body_part_set &parts) const |
| bool | is_wearing (const itype_id &it) const |
| Returns true if the player is wearing the item. More... | |
| bool | is_wearing_on_bp (const itype_id &it, const bodypart_id &bp) const |
| Returns true if the player is wearing the item on the given body part. More... | |
| bool | worn_with_flag (const flag_id &flag, const bodypart_id &bp) const |
| Returns true if the player is wearing an item with the given flag. More... | |
| bool | worn_with_flag (const flag_id &flag) const |
| item | item_worn_with_flag (const flag_id &flag, const bodypart_id &bp) const |
| Returns the first worn item with a given flag. More... | |
| item | item_worn_with_flag (const flag_id &flag) const |
| item * | item_worn_with_id (const itype_id &id) |
| Returns pointer of the first worn item with a given id. More... | |
| std::vector< std::pair< std::string, std::string > > | get_overlay_ids () const |
| Returns a list of the IDs of overlays on this character, sorted from "lowest" to "highest". More... | |
| std::vector< std::pair< std::string, std::string > > | get_overlay_ids_when_override_look () const |
| Returns a list of the IDs of overlays on this character if the character has override look mutations sorted from "lowest" to "highest". More... | |
| float | get_skill_level (const skill_id &ident) const |
| float | get_skill_level (const skill_id &ident, const item &context) const |
| int | get_knowledge_level (const skill_id &ident) const |
| float | get_knowledge_plus_progress (const skill_id &ident) const |
| int | get_knowledge_level (const skill_id &ident, const item &context) const |
| float | get_average_skill_level (const skill_id &ident) const |
| float | get_greater_skill_or_knowledge_level (const skill_id &ident) const |
| SkillLevelMap | get_all_skills () const |
| SkillLevel & | get_skill_level_object (const skill_id &ident) |
| const SkillLevel & | get_skill_level_object (const skill_id &ident) const |
| void | set_skill_level (const skill_id &ident, int level) |
| void | mod_skill_level (const skill_id &ident, int delta) |
| void | set_knowledge_level (const skill_id &ident, int level) |
| void | mod_knowledge_level (const skill_id &ident, int delta) |
| bool | meets_skill_requirements (const std::map< skill_id, int > &req, const item &context=item()) const |
| Checks whether the character's skills meet the required. More... | |
| bool | meets_skill_requirements (const construction &con) const |
| Checks whether the character's skills meet the required. More... | |
| bool | meets_stat_requirements (const item &it) const |
| Checks whether the character's stats meets the stats required by the item. More... | |
| bool | meets_requirements (const item &it, const item &context=item()) const |
| Checks whether the character meets overall requirements to be able to use the item. More... | |
| std::string | enumerate_unmet_requirements (const item &it, const item &context=item()) const |
| Returns a string of missed requirements (both stats and skills) More... | |
| int | read_speed () const |
| Returns the player's reading speed as a percentage. More... | |
| int | lie_skill () const |
| Returns a value used when attempting to convince NPC's of something false. More... | |
| int | persuade_skill () const |
| Returns a value used when attempting to convince NPC's of something true. More... | |
| int | intimidation () const |
| Returns a value used when attempting to intimidate NPC's. More... | |
| void | set_skills_from_hobbies () |
| void | set_bionics_from_hobbies () |
| bool | has_proficiency (const proficiency_id &prof) const |
| float | get_proficiency_practice (const proficiency_id &prof) const |
| time_duration | get_proficiency_practiced_time (const proficiency_id &prof) const |
| bool | has_prof_prereqs (const proficiency_id &prof) const |
| void | add_proficiency (const proficiency_id &prof, bool ignore_requirements=false) |
| void | lose_proficiency (const proficiency_id &prof, bool ignore_requirements=false) |
| bool | practice_proficiency (const proficiency_id &prof, const time_duration &amount, const std::optional< time_duration > &max=std::nullopt) |
| time_duration | proficiency_training_needed (const proficiency_id &prof) const |
| void | set_proficiency_practiced_time (const proficiency_id &prof, int turns) |
| std::vector< display_proficiency > | display_proficiencies () const |
| std::vector< proficiency_id > | known_proficiencies () const |
| std::vector< proficiency_id > | learning_proficiencies () const |
| int | get_proficiency_bonus (const std::string &category, proficiency_bonus_type prof_bonus) const |
| void | add_default_background () |
| void | set_proficiencies_from_hobbies () |
| void | set_proficiency_practice (const proficiency_id &id, const time_duration &amount) |
| time_point | get_time_died () const |
| return the calendar::turn the character expired More... | |
| void | set_time_died (const time_point &time) |
| set the turn the turn the character died if not already done More... | |
| std::vector< spell > | spells_known_of_class (const trait_id &spell_class) const |
| bool | cast_spell (spell &sp, bool fake_spell, const std::optional< tripoint > &target) |
| bool | avoid_trap (const tripoint &pos, const trap &tr) const override |
| Called when a player triggers a trap, returns true if they don't set it off. More... | |
| bool | add_faction_warning (const faction_id &id) const |
| int | current_warnings_fac (const faction_id &id) |
| bool | beyond_final_warning (const faction_id &id) |
| const Character * | get_book_reader (const item &book, std::vector< std::string > &reasons) const |
| Helper function for player::read. More... | |
| time_duration | time_to_read (const item &book, const Character &reader, const Character *learner=nullptr) const |
| Helper function for get_book_reader. More... | |
| read_condition_result | check_read_condition (const item &book) const |
| Helper function for get_book_reader. More... | |
| void | normalize () override |
| Calls Creature::normalize() nulls out the player's weapon Should only be called through player::normalize(), not on it's own! More... | |
| std::string | get_name () const override |
| std::vector< std::string > | get_grammatical_genders () const override |
| template<typename ... Args> | |
| bool | query_yn (const char *const msg, Args &&... args) const |
| It is supposed to hide the query_yn to simplify player vs. More... | |
| std::pair< bodypart_id, int > | best_part_to_smash () const |
| bool | check_immunity_data (const field_immunity_data &ft) const override |
| bool | is_immune_field (const field_type_id &fid) const override |
| Returns true if we are immune to the field type with the given fid. More... | |
| bool | is_elec_immune () const override |
| Returns true is the player is protected from electric shocks. More... | |
| bool | is_immune_effect (const efftype_id &) const override |
| Returns true if the player is immune to this kind of effect. More... | |
| bool | is_immune_damage (const damage_type_id &) const override |
| Returns true if the player is immune to this kind of damage. More... | |
| bool | is_rad_immune () const |
| Returns true if the player is protected from radiation. More... | |
| bool | is_knockdown_immune () const |
| Returns true if the player is immune to knockdowns. More... | |
| bool | is_melee_bash_damage_cap_bonus () const |
| Returns true if the player's melee skill increases the bash damage weapon cap. More... | |
| bool | immune_to (const bodypart_id &bp, damage_unit dam) const |
| Check if a given body part is immune to a given damage type. More... | |
| void | mod_pain (int npain) override |
| Modifies a pain value by player traits before passing it to Creature::mod_pain() More... | |
| void | set_pain (int npain) override |
| Sets new intensity of pain an reacts to it. More... | |
| int | get_perceived_pain () const override |
| Returns perceived pain (reduced with painkillers) More... | |
| float | fall_damage_mod () const override |
| Returns multiplier on fall damage at low velocity (knockback/pit/1 z-level, not 5 z-levels) More... | |
| int | impact (int force, const tripoint &pos) override |
| Deals falling/collision damage with terrain/creature at pos. More... | |
| bool | can_fly () |
| Checks to see if the character is able to use their wings properly. More... | |
| void | knock_back_to (const tripoint &to) override |
| Knocks the player to a specified tile. More... | |
| int | hp_percentage () const override |
| Returns overall % of HP remaining. More... | |
| bool | has_nv () |
| Returns true if the player has some form of night vision. More... | |
| int | get_lift_assist () const |
| float | rest_quality () const |
| Returns >0 if character is sitting/lying and relatively inactive. More... | |
| float | healing_rate (float at_rest_quality) const |
| Average hit points healed per turn. More... | |
| float | healing_rate_medicine (float at_rest_quality, const bodypart_id &bp) const |
| Average hit points healed per turn from healing effects. More... | |
| social_modifiers | get_mutation_bionic_social_mods () const |
| Goes over all mutations/bionics, returning the sum of the social modifiers. More... | |
| nc_color | symbol_color () const override |
| Creature symbol background color. More... | |
| const std::string & | symbol () const override |
| Creature symbol. More... | |
| std::string | mutation_name (const trait_id &mut) const |
| std::string | mutation_desc (const trait_id &mut) const |
| void | empty_skills () |
| void | pick_name (bool bUseDefault=false) |
| Returns a random name from NAMES_*. More... | |
| std::vector< trait_id > | get_base_traits () const |
| Get the idents of all base traits. More... | |
| std::vector< trait_id > | get_mutations (bool include_hidden=true, bool ignore_enchantment=false, const std::function< bool(const mutation_branch &)> &filter=nullptr) const |
| Get the idents of all traits/mutations. More... | |
| std::vector< trait_and_var > | get_mutations_variants (bool include_hidden=true, bool ignore_enchantment=false) const |
| Same as above, but also grab the variant ids (or empty string if none) More... | |
| const std::bitset< NUM_VISION_MODES > & | get_vision_modes () const |
| void | clear_mutations () |
| Empties the trait and mutations lists. More... | |
| void | toggle_trait_deps (const trait_id &tr, const std::string &variant="") |
| Steps through the dependency chain for the given trait. More... | |
| void | add_traits () |
| Adds mandatory scenario and profession traits unless you already have them And if you do already have them, refunds the points for the trait. More... | |
| bool | crossed_threshold () const |
| Returns true if the player has crossed a mutation threshold Player can only cross one mutation threshold. More... | |
| mutation_category_id | get_threshold_category () const |
| Returns the category that the player has crossed the threshold of, if they have one. More... | |
| void | environmental_revert_effect () |
| int | climbing_cost (const tripoint &from, const tripoint &to) const |
Checks both the neighborhoods of from and to for climbable surfaces, returns move cost of climbing from from to to. More... | |
| bodypart_id | most_staunchable_bp () |
| Which body part has the most staunchable bleeding, and what is the max improvement. More... | |
| bodypart_id | most_staunchable_bp (int &max) |
| void | pause () |
| template<typename T > | |
| bool | can_lift (const T &obj) const |
| Check player strong enough to lift an object unaided by equipment (jacks, levers etc) More... | |
| item_location | get_wielded_item () const |
| item_location | get_wielded_item () |
| void | set_wielded_item (const item &to_wield) |
| std::vector< matype_id > | known_styles (bool teachable_only) const |
| bool | has_martialart (const matype_id &m) const |
| int | get_oxygen_max () const |
| bool | can_recover_oxygen () const |
| void | randomize_blood () |
| void | randomize_heartrate () |
| int | get_focus () const |
| void | mod_focus (int amount) |
| void | set_focus (int amount) |
| void | queue_effect (const std::string &name, const time_duration &delay, const time_duration &duration) |
| Queue an EOC to add effect after a delay. More... | |
| int | count_queued_effects (const std::string &effect) const |
| Count queued add_effect EOCs for specific effect. More... | |
| void | add_addiction (const addiction_id &type, int strength) |
| Adds an addiction to the player. More... | |
| void | rem_addiction (const addiction_id &type) |
| Removes an addition from the player. More... | |
| bool | has_addiction (const addiction_id &type) const |
| Returns true if the player has an addiction of the specified type. More... | |
| int | addiction_level (const addiction_id &type) const |
| Returns the intensity of the specified addiction. More... | |
| bool | knows_creature_type (const Creature *c) const |
| Returns true if the character is familiar with the given creature type. More... | |
| bool | knows_creature_type (const mtype_id &c) const |
| Returns true if the character is familiar with the given creature type. More... | |
| void | set_knows_creature_type (const Creature *c) |
| This character becomes familiar with creatures of the given type. More... | |
| void | set_knows_creature_type (const mtype_id &c) |
| This character becomes familiar with creatures of the given type. More... | |
| const std::set< mtype_id > & | get_known_monsters () const |
| Returns a list of all monster types known by this character. More... | |
| void | toggle_hauling () |
| void | start_hauling (const std::vector< item_location > &items_to_haul) |
| void | stop_hauling () |
| bool | is_hauling () const |
| void | start_autohaul () |
| void | stop_autohaul () |
| bool | is_autohauling () const |
| bool | trim_haul_list (const std::vector< item_location > &valid_items) |
| void | cache_visit_items_with (const itype_id &type, const std::function< void(item &)> &do_func) |
| Applies a lambda function on all items with the given flag and/or that pass the given boolean item function, using or creating caches from inv_search_caches. More... | |
| void | cache_visit_items_with (const flag_id &type_flag, const std::function< void(item &)> &do_func) |
| void | cache_visit_items_with (const std::string &key, bool(item::*filter_func)() const, const std::function< void(item &)> &do_func) |
| void | cache_visit_items_with (const std::string &key, const itype_id &type, const flag_id &type_flag, bool(item::*filter_func)() const, const std::function< void(item &)> &do_func) |
| void | cache_visit_items_with (const itype_id &type, const std::function< void(const item &)> &do_func) const |
| void | cache_visit_items_with (const flag_id &type_flag, const std::function< void(const item &)> &do_func) const |
| void | cache_visit_items_with (const std::string &key, bool(item::*filter_func)() const, const std::function< void(const item &)> &do_func) const |
| void | cache_visit_items_with (const std::string &key, const itype_id &type, const flag_id &type_flag, bool(item::*filter_func)() const, const std::function< void(const item &)> &do_func) const |
| bool | cache_has_item_with (const itype_id &type, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| Returns true if the character has an item with given flag and/or that passes the given boolean item function, using or creating caches from inv_search_caches. More... | |
| bool | cache_has_item_with (const flag_id &type_flag, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| bool | cache_has_item_with (const std::string &key, bool(item::*filter_func)() const, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| bool | cache_has_item_with (const std::string &key, const itype_id &type, const flag_id &type_flag, bool(item::*filter_func)() const, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| bool | has_item_with_flag (const flag_id &flag, bool need_charges=false) const |
| Find if the character has an item with a specific flag. More... | |
| bool | cache_has_item_with_flag (const flag_id &type_flag, bool need_charges=false) const |
| Find if the character has an item whose type has a specific flag. More... | |
| std::vector< item * > | cache_get_items_with (const itype_id &type, const std::function< bool(item &)> &do_and_check_func=return_true< item >) |
| Returns all items with the given flag and/or that pass the given boolean item function, using or creating caches from inv_search_caches. More... | |
| std::vector< item * > | cache_get_items_with (const flag_id &type_flag, const std::function< bool(item &)> &do_and_check_func=return_true< item >) |
| std::vector< item * > | cache_get_items_with (const std::string &key, bool(item::*filter_func)() const, const std::function< bool(item &)> &do_and_check_func=return_true< item >) |
| std::vector< item * > | cache_get_items_with (const std::string &key, const itype_id &type, const flag_id &type_flag, bool(item::*filter_func)() const, const std::function< bool(item &)> &do_and_check_func=return_true< item >) |
| std::vector< const item * > | cache_get_items_with (const itype_id &type, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| std::vector< const item * > | cache_get_items_with (const flag_id &type_flag, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| std::vector< const item * > | cache_get_items_with (const std::string &key, bool(item::*filter_func)() const, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| std::vector< const item * > | cache_get_items_with (const std::string &key, const itype_id &type, const flag_id &type_flag, bool(item::*filter_func)() const, const std::function< bool(const item &)> &check_func=return_true< item >) const |
| void | add_to_inv_search_caches (item &it) const |
| Add an item to existing inv_search_caches that it meets the criteria for. More... | |
| bool | has_charges (const itype_id &it, int quantity, const std::function< bool(const item &)> &filter=return_true< item >) const override |
| std::list< item > | use_amount (const itype_id &it, int quantity, const std::function< bool(const item &)> &filter=return_true< item >, bool select_ind=false) |
| bool | use_charges_if_avail (const itype_id &it, int quantity) |
| units::energy | available_ups () const |
| Available ups from all sources Sum of mech, bionic UPS and UPS. More... | |
| units::energy | consume_ups (units::energy qty, int radius=-1) |
| Consume UPS charges. More... | |
| std::list< item > | use_charges (const itype_id &what, int qty, const std::function< bool(const item &)> &filter=return_true< item >) |
| Use charges in character inventory. More... | |
| std::list< item > | use_charges (const itype_id &what, int qty, int radius, const std::function< bool(const item &)> &filter=return_true< item >, bool in_tools=false) |
| Use charges within a radius. More... | |
| item | find_firestarter_with_charges (int quantity) const |
| bool | has_fire (int quantity) const |
| void | use_fire (int quantity) |
| void | assign_stashed_activity () |
| bool | check_outbounds_activity (const player_activity &act, bool check_only=false) |
| void | assign_activity (const activity_id &type, int moves=calendar::INDEFINITELY_LONG, int index=-1, int pos=INT_MIN, const std::string &name="") |
| void | assign_activity (const player_activity &act) |
| Assigns activity to player, possibly resuming old activity if it's defined resumable. More... | |
| void | assign_activity (const activity_actor &actor) |
| Assigns activity actor to player, possibly resuming old activity if it's defined resumable. More... | |
| bool | has_activity (const activity_id &type) const |
| Check if player currently has a given activity. More... | |
| bool | has_activity (const std::vector< activity_id > &types) const |
| Check if player currently has any of the given activities. More... | |
| void | resume_backlog_activity () |
| void | cancel_activity () |
| void | cancel_stashed_activity () |
| player_activity | get_stashed_activity () const |
| void | set_stashed_activity (const player_activity &act, const player_activity &act_back=player_activity()) |
| bool | has_stashed_activity () const |
| bool | can_stash (const item &it, bool ignore_pkt_settings=false) |
| bool | can_stash (const item &it, int &copies_remaining, bool ignore_pkt_settings=false) |
| bool | can_stash_partial (const item &it, bool ignore_pkt_settings=false) |
| void | initialize_stomach_contents () |
| float | metabolic_rate_base () const |
| Stable base metabolic rate due to traits. More... | |
| float | metabolic_rate () const |
| Current metabolic rate due to traits, hunger, speed, etc. More... | |
| int | get_max_healthy () const |
| float | get_bmi () const |
| float | get_bmi_fat () const |
| float | get_bmi_lean () const |
| int | get_bmr () const |
| virtual void | add_spent_calories (int) |
| virtual void | add_gained_calories (int) |
| virtual void | log_activity_level (float) |
| void | reset_chargen_attributes () |
| int | base_age () const |
| void | set_base_age (int age) |
| void | mod_base_age (int mod) |
| int | age (time_point when=calendar::turn) const |
| std::string | age_string (time_point when=calendar::turn) const |
| int | base_height () const |
| void | set_base_height (int height) |
| void | mod_base_height (int mod) |
| std::string | height_string () const |
| int | height () const |
| void | randomize_height () |
| units::mass | bodyweight () const |
| units::mass | bodyweight_lean () const |
| units::mass | bodyweight_fat () const |
| float | fat_ratio () const |
| units::mass | bionics_weight () const |
| void | set_activity_level (float new_level) |
| void | decrease_activity_level (float new_level) |
| void | reset_activity_level () |
| std::string | activity_level_str () const |
| int | get_env_resist (bodypart_id bp) const override |
| Returns overall env_resist on a body_part. More... | |
| int | get_armor_type (const damage_type_id &dt, bodypart_id bp) const override |
| Returns overall resistance to given type on the bod part. More... | |
| std::map< bodypart_id, int > | get_all_armor_type (const damage_type_id &dt, const std::map< bodypart_id, std::vector< const item * >> &clothing_map) const |
| int | get_stim () const |
| void | set_stim (int new_stim) |
| void | mod_stim (int mod) |
| int | get_rad () const |
| void | set_rad (int new_rad) |
| void | mod_rad (int mod) |
| float | get_heartrate_index () const |
| void | set_heartrate_effect_mod (int mod) |
| void | modify_heartrate_effect_mod (int mod) |
| int | get_heartrate_effect_mod () const |
| void | update_heartrate_index () |
| float | get_bloodvol_index () const |
| void | update_bloodvol_index () |
| float | get_circulation_resistance () const |
| void | set_bp_effect_mod (int mod) |
| void | modify_bp_effect_mod (int mod) |
| int | get_bp_effect_mod () const |
| void | update_circulation_resistance () |
| float | get_respiration_rate () const |
| void | set_respiration_effect_mod (int mod) |
| int | get_respiration_effect_mod () const |
| void | modify_respiration_effect_mod (int mod) |
| void | update_respiration_rate () |
| void | update_circulation () |
| int | get_stamina () const |
| int | get_stamina_max () const |
| void | set_stamina (int new_stamina) |
| void | burn_energy_arms (int mod) |
| void | burn_energy_legs (int mod) |
| void | burn_energy_all (int mod) |
| float | get_bionic_limb_percentage () const |
| void | mod_stamina (int mod) |
| void | burn_move_stamina (int moves) |
| void | update_stamina (int turns) |
| Regenerates stamina. More... | |
| int | get_cardiofit () const |
| int | get_cardio_acc () const |
| void | set_cardio_acc (int ncardio_acc) |
| void | reset_cardio_acc () |
| int | get_cardio_acc_base () const |
| bool | handle_gun_damage (item &it) |
| Returns true if a gun misfires, jams, or has other problems, else returns false. More... | |
| bool | handle_gun_overheat (item &it) |
| Handles overheat mechanics for guns, returns true if the gun cant fire due to overheat effects. More... | |
| double | recoil_vehicle () const |
| Get maximum recoil penalty due to vehicle motion. More... | |
| double | recoil_total () const |
| Current total maximum recoil penalty from all sources. More... | |
| int | gun_engagement_moves (const item &gun, int target=0, int start=MAX_RECOIL, const Target_attributes &attributes=Target_attributes()) const |
| How many moves does it take to aim gun to the target accuracy. More... | |
| int | fire_gun (const tripoint &target, int shots=1) |
| Fires a gun or auxiliary gunmod (ignoring any current mode) More... | |
| int | fire_gun (const tripoint &target, int shots, item &gun) |
| Fires a gun or auxiliary gunmod (ignoring any current mode) More... | |
| dealt_projectile_attack | throw_item (const tripoint &target, const item &to_throw, const std::optional< tripoint > &blind_throw_from_pos=std::nullopt) |
| Execute a throw. More... | |
| void | on_item_wear (const item &it) |
| Called when an item is worn. More... | |
| void | on_item_takeoff (const item &it) |
| Called when an item is taken off. More... | |
| void | enchantment_wear_change () |
| void | on_worn_item_washed (const item &it) |
| Called when an item is washed. More... | |
| void | on_item_acquire (const item &it) |
| Called when an item is acquired (picked up, worn, or wielded) More... | |
| void | on_effect_int_change (const efftype_id &eid, int intensity, const bodypart_id &bp=bodypart_id("bp_null")) override |
| Called when effect intensity has been changed. More... | |
| void | on_mutation_gain (const trait_id &mid) |
| Called when a mutation is gained. More... | |
| void | on_mutation_loss (const trait_id &mid) |
| Called when a mutation is lost. More... | |
| void | on_stat_change (const std::string &stat, int value) override |
| Called when a stat is changed. More... | |
| tripoint | adjacent_tile () const |
| Returns an unoccupied, safe adjacent point. More... | |
| bool | has_opposite_trait (const trait_id &flag) const |
| Returns true if the player has a trait which cancels the entered trait. More... | |
| std::unordered_set< trait_id > | get_opposite_traits (const trait_id &flag) const |
| Returns traits that cancel the entered trait. More... | |
| virtual void | wake_up () |
| Removes "sleep" and "lying_down". More... | |
| int | get_shout_volume () const |
| void | shout (std::string msg="", bool order=false) |
| void | signal_nemesis () |
| void | vomit () |
| Handles Character vomiting effects. More... | |
| void | customize_appearance (customize_appearance_choice choice) |
| float | adjust_for_focus (float amount) const |
| void | update_type_of_scent (bool init=false) |
| void | update_type_of_scent (const trait_id &mut, bool gain=true) |
| void | set_type_of_scent (const scenttype_id &id) |
| scenttype_id | get_type_of_scent () const |
| void | restore_scent () |
| restore scent after masked_scent effect run out or is removed by water More... | |
| void | mod_painkiller (int npkill) |
| Modifies intensity of painkillers More... | |
| void | set_painkiller (int npkill) |
| Sets intensity of painkillers More... | |
| int | get_painkiller () const |
| Returns intensity of painkillers More... | |
| void | react_to_felt_pain (int intensity) |
| void | clear_moncams () |
| Monster cameras are mtype_ids with an integer range of transmission. More... | |
| void | remove_moncam (const mtype_id &moncam_id) |
| void | add_moncam (const std::pair< mtype_id, int > &moncam) |
| void | set_moncams (std::map< mtype_id, int > nmoncams) |
| std::map< mtype_id, int > const & | get_moncams () const |
| moncam_cache_t | get_active_moncams () const |
| void | spores () |
| void | blossoms () |
| void | rooted_message () const |
| Handles rooting effects. More... | |
| void | rooted () |
| void | fall_asleep () |
| Adds "sleep" to the player. More... | |
| void | fall_asleep (const time_duration &duration) |
| std::string | is_snuggling () const |
| Checks to see if the player is using floor items to keep warm, and return the name of one such item if so. More... | |
| ret_val< crush_tool_type > | can_crush_frozen_liquid (item_location const &loc) const |
| bool | crush_frozen_liquid (item_location loc) |
| Prompts user about crushing item at item_location loc, for harvesting of frozen liquids. More... | |
| float | power_rating () const override |
| Returns an approximation of the creature's strength. More... | |
| bool | sees_with_infrared (const Creature &critter) const |
| Check whether the this player can see the other creature with infrared. More... | |
| void | place_corpse () |
| void | place_corpse (const tripoint_abs_omt &om_target) |
| std::vector< run_cost_effect > | run_cost_effects (float &movecost) const |
| Modifies the movement cost and returns a list of effects. More... | |
| int | run_cost (int base_cost, bool diag=false) const |
| Returns the player's modified base movement cost. More... | |
| std::vector< Creature * > | get_hostile_creatures (int range) const |
| Get all hostile creatures currently visible to this player. More... | |
| std::vector< Creature * > | get_visible_creatures (int range) const |
| Returns all creatures that this player can see and that are in the given range. More... | |
| std::vector< Creature * > | get_targetable_creatures (int range, bool melee) const |
| As above, but includes all creatures the player can detect well enough to target with ranged weapons, e.g. More... | |
| int | get_mutation_visibility_cap (const Character *observed) const |
| Returns the mutation visibility threshold for the observer ( *this ) More... | |
| std::string | visible_mutations (int visibility_cap) const |
| Returns an enumeration of visible mutations with colors. More... | |
| player_activity | get_destination_activity () const |
| void | set_destination_activity (const player_activity &new_destination_activity) |
| void | clear_destination_activity () |
| bool | can_use_pockets () const |
| bool | can_use_hood () const |
| bool | can_use_collar () const |
| std::map< bodypart_id, int > | bonus_item_warmth () const |
| Returns warmth provided by an armor's bonus, like hoods, pockets, etc. More... | |
| bool | can_use_floor_warmth () const |
| Can the player lie down and cover self with blankets etc. More... | |
| units::temperature_delta | floor_warmth (const tripoint &pos) const |
| Final warmth from the floor. More... | |
| units::temperature_delta | bodytemp_modifier_traits (bool overheated) const |
| Correction factor of the body temperature due to traits and mutations. More... | |
| units::temperature | temp_corrected_by_climate_control (units::temperature temperature, int heat_strength, int chill_strength) const |
| Value of the body temperature corrected by climate control. More... | |
| bool | in_sleep_state () const override |
| void | update_vitamins (const vitamin_id &vit) |
| Set vitamin deficiency/excess disease states dependent upon current vitamin levels. More... | |
| int | vitamin_get (const vitamin_id &vit) const |
| Check current level of a vitamin. More... | |
| int | get_daily_vitamin (const vitamin_id &vit, bool actual=true) const |
| void | vitamin_set (const vitamin_id &vit, int qty) |
| Sets level of a vitamin. More... | |
| int | vitamin_mod (const vitamin_id &vit, int qty) |
| Add or subtract vitamins from character storage pools. More... | |
| void | vitamins_mod (const std::map< vitamin_id, int > &) |
| time_duration | vitamin_rate (const vitamin_id &vit) const |
| Get vitamin usage rate (minutes per unit) accounting for bionics, mutations and effects. More... | |
| std::map< vitamin_id, int > | effect_vitamin_mod (const std::map< vitamin_id, int > &) |
| Modify vitamin intake (e.g. More... | |
| void | clear_vitamins () |
| Remove all vitamins. More... | |
| void | reset_daily_vitamin (const vitamin_id &vit) |
| int | nutrition_for (const item &comest) const |
| Handles the nutrition value for a comestible. More... | |
| ret_val< edible_rating > | can_eat (const item &food) const |
| Can the food be [theoretically] eaten no matter the consequences? More... | |
| ret_val< edible_rating > | will_eat (const item &food, bool interactive=false) const |
| Same as can_eat, but takes consequences into account. More... | |
| int | get_acquirable_energy (const item &it) const |
| Determine character's capability of recharging their CBMs. More... | |
| void | modify_stimulation (const islot_comestible &comest) |
| Used to apply stimulation modifications from food and medication. More... | |
| void | modify_sleepiness (const islot_comestible &comest) |
| Used to apply sleepiness modifications from food and medication. More... | |
| void | modify_radiation (const islot_comestible &comest) |
| void | modify_addiction (const islot_comestible &comest) |
| Used to apply addiction modifications from food and medication. More... | |
| void | modify_health (const islot_comestible &comest) |
| Used to apply health modifications from food and medication. More... | |
| double | compute_effective_food_volume_ratio (const item &food) const |
| Used to compute how filling a food is. More... | |
| units::volume | masticated_volume (const item &food) const |
| Used to calculate dry volume of a chewed food. More... | |
| int | compute_calories_per_effective_volume (const item &food, const nutrients *nutrient=nullptr) const |
| Used to to display how filling a food is. More... | |
| bool | consume_effects (item &food) |
| Handles the effects of consuming an item. More... | |
| bool | can_consume_as_is (const item &it) const |
| Check whether the character can consume this very item. More... | |
| bool | can_estimate_rot () const |
| True if the character has enough skill (in cooking or survival) to estimate time to rot. More... | |
| item & | get_consumable_from (item &it) const |
| Returns a reference to the item itself (if it's consumable), the first of its contents (if it's consumable) or null item otherwise. More... | |
| std::pair< nutrients, nutrients > | compute_nutrient_range (const item &, const recipe_id &, std::map< recipe_id, std::pair< nutrients, nutrients >> &rec_cache, const cata::flat_set< flag_id > &extra_flags={}) const |
| Get calorie & vitamin contents for a comestible, taking into account character traits. More... | |
| std::pair< nutrients, nutrients > | compute_nutrient_range (const itype_id &, std::map< recipe_id, std::pair< nutrients, nutrients >> &rec_cache, const cata::flat_set< flag_id > &extra_flags={}) const |
| Same, but across arbitrary recipes. More... | |
| morale_type | allergy_type (const item &food) const |
| Returns allergy type or MORALE_NULL if not allergic for this character. More... | |
| nutrients | compute_effective_nutrients (const item &) const |
| bool | wearing_something_on (const bodypart_id &bp) const |
| Returns true if the character is wearing something on the entered body part. More... | |
| bool | wearing_fitting_on (const bodypart_id &bp) const |
| Returns true if the character is wearing something on the entered body part. More... | |
| double | armwear_factor () const |
| Same as footwear factor, but for arms. More... | |
| int | shoe_type_count (const itype_id &it) const |
| Returns 1 if the player is wearing an item of that count on one foot, 2 if on both, and zero if on neither. More... | |
| bool | is_wearing_shoes (const side &check_side=side::BOTH) const |
| Returns true if the player is wearing something on their feet that is not SKINTIGHT. More... | |
| bool | is_barefoot () const |
| Returns true if the player is not wearing anything that covers the soles of their feet, ignoring INTEGRATED. More... | |
| bool | is_worn_item_visible (std::list< item >::const_iterator) const |
| Returns true if the worn item is visible (based on layering and coverage) More... | |
| std::list< item > | get_visible_worn_items () const |
| Returns all worn items visible to an outside observer. More... | |
| bool | change_side (item &it, bool interactive=true) |
| Swap side on which item is worn; returns false on fail. More... | |
| bool | change_side (item_location &loc, bool interactive=true) |
| bool | get_check_encumbrance () const |
| void | set_check_encumbrance (bool new_check) |
| void | update_morale () |
| Ticks down morale counters and removes them. More... | |
| void | apply_persistent_morale () |
| Ensures persistent morale effects are up-to-date. More... | |
| void | hoarder_morale_penalty () |
| void | modify_morale (item &food, int nutr=0) |
| Used to apply morale modifications from food and medication. More... | |
| int | get_morale_level () const |
| void | add_morale (const morale_type &type, int bonus, int max_bonus=0, const time_duration &duration=1_hours, const time_duration &decay_start=30_minutes, bool capped=false, const itype *item_type=nullptr) |
| int | has_morale (const morale_type &type) const |
| void | rem_morale (const morale_type &type, const itype *item_type=nullptr) |
| void | clear_morale () |
| bool | has_morale_to_read () const |
| bool | has_morale_to_craft () const |
| const inventory & | crafting_inventory (bool clear_path) const |
| const inventory & | crafting_inventory (const tripoint &src_pos=tripoint_zero, int radius=PICKUP_RANGE, bool clear_path=true) const |
| Returns items that can be used to craft with. More... | |
| void | invalidate_crafting_inventory () |
| float | fine_detail_vision_mod (const tripoint &p=tripoint_min) const |
| Returns a value from 1.0 to 11.0 that acts as a multiplier for the time taken to perform tasks that require detail vision, above 4.0 means these activities cannot be performed. More... | |
| void | make_craft_with_command (const recipe_id &id_to_make, int batch_size, bool is_long, const std::optional< tripoint > &loc) |
| bool | has_recipe (const recipe *r) const |
| bool | knows_recipe (const recipe *rec) const |
| void | learn_recipe (const recipe *rec) |
| void | forget_recipe (const recipe *rec) |
| void | forget_all_recipes () |
| int | exceeds_recipe_requirements (const recipe &rec) const |
| bool | has_recipe_requirements (const recipe &rec) const |
| bool | can_decomp_learn (const recipe &rec) const |
| bool | studied_all_recipes (const itype &book) const |
| const recipe_subset & | get_learned_recipes () const |
| Returns all known recipes. More... | |
| recipe_subset | get_available_nested (const recipe_subset &) const |
| recipe_subset | get_recipes_from_books (const inventory &crafting_inv) const |
| Returns all recipes that are known from the books (either in inventory or nearby). More... | |
| recipe_subset | get_recipes_from_ebooks (const inventory &crafting_inv) const |
| Returns all recipes that are known from the books inside ereaders (either in inventory or nearby). More... | |
| recipe_subset | get_group_available_recipes () const |
Return all available recipes for any member of this crafter's group. More... | |
| std::set< itype_id > | get_books_for_recipe (const inventory &crafting_inv, const recipe *r) const |
| Returns the set of book types in crafting_inv that provide the given recipe. More... | |
| float | morale_crafting_speed_multiplier (const recipe &rec) const |
| float | lighting_craft_speed_multiplier (const recipe &rec, const tripoint &p=tripoint_min) const |
| float | crafting_speed_multiplier (const recipe &rec) const |
| float | workbench_crafting_speed_multiplier (const item &craft, const std::optional< tripoint > &loc) const |
| float | crafting_speed_multiplier (const item &craft, const std::optional< tripoint > &loc, bool use_cached_workbench_multiplier=false, float cached_workbench_multiplier=0.0f) const |
| For use with in progress crafts. More... | |
| int | available_assistant_count (const recipe &rec) const |
| int64_t | expected_time_to_craft (const recipe &rec, int batch_size=1) const |
| Expected time to craft a recipe, with assumption that multipliers stay constant. More... | |
| std::vector< const item * > | get_eligible_containers_for_crafting () const |
| bool | check_eligible_containers_for_crafting (const recipe &rec, int batch_size=1) const |
| bool | can_make (const recipe *r, int batch_size=1) const |
| bool | can_start_craft (const recipe *rec, recipe_filter_flags, int batch_size=1) const |
| Returns true if the player can start crafting the recipe with the given batch size The player is not required to have enough tool charges to finish crafting, only to complete the first step (total / 20 + total % 20 charges) More... | |
| bool | making_would_work (const recipe_id &id_to_make, int batch_size) const |
| void | craft (const std::optional< tripoint > &loc=std::nullopt, const recipe_id &goto_recipe=recipe_id(), const std::string &filterstring="") |
| Start various types of crafts. More... | |
| void | recraft (const std::optional< tripoint > &loc=std::nullopt) |
| void | long_craft (const std::optional< tripoint > &loc=std::nullopt, const recipe_id &goto_recipe=recipe_id()) |
| void | make_craft (const recipe_id &id, int batch_size, const std::optional< tripoint > &loc=std::nullopt) |
| void | make_all_craft (const recipe_id &id, int batch_size, const std::optional< tripoint > &loc) |
| void | start_craft (craft_command &command, const std::optional< tripoint > &loc) |
| consume components and create an active, in progress craft containing them More... | |
| float | crafting_success_roll (const recipe &making) const |
| Calculate a value representing the success of the player at crafting the given recipe, taking player skill, recipe difficulty, npc helpers, and player mutations into account. More... | |
| float | crafting_failure_roll (const recipe &making) const |
| float | get_recipe_weighted_skill_average (const recipe &making) const |
| float | recipe_success_chance (const recipe &making) const |
| float | item_destruction_chance (const recipe &making) const |
| craft_roll_data | recipe_success_roll_data (const recipe &making) const |
| craft_roll_data | recipe_failure_roll_data (const recipe &making) const |
| void | complete_craft (item &craft, const std::optional< tripoint > &loc) |
| bool | can_continue_craft (item &craft) |
| Check if the player meets the requirements to continue the in progress craft and if unable to continue print messages explaining the reason. More... | |
| bool | can_continue_craft (item &craft, const requirement_data &continue_reqs) |
| std::vector< Character * > | get_crafting_helpers () const |
| Return nearby Characters ready and willing to help with crafting. More... | |
| std::vector< Character * > | get_crafting_group () const |
| Return group of ally characters sharing knowledge of crafting. More... | |
| int | get_num_crafting_helpers (int max) const |
| bool | craft_skill_gain (const item &craft, const int &num_practice_ticks) |
| Handle skill gain for player and followers during crafting. More... | |
| bool | craft_proficiency_gain (const item &craft, const time_duration &time) |
| Handle proficiency practice for player and followers while crafting. More... | |
| ret_val< void > | can_disassemble (const item &obj, const read_only_visitable &inv) const |
| Check if the player can disassemble an item using the current crafting inventory. More... | |
| item_location | create_in_progress_disassembly (item_location target) |
| bool | disassemble () |
| bool | disassemble (item_location target, bool interactive=true, bool disassemble_all=false) |
| void | disassemble_all (bool one_pass) |
| void | complete_disassemble (item_location target) |
| Completely disassemble an item, and drop yielded components at its former position. More... | |
| void | complete_disassemble (item_location &target, const recipe &dis) |
| const requirement_data * | select_requirements (const std::vector< const requirement_data * > &, int batch, const read_only_visitable &, const std::function< bool(const item &)> &filter) const |
| comp_selection< item_comp > | select_item_component (const std::vector< item_comp > &components, int batch, read_only_visitable &map_inv, bool can_cancel=false, const std::function< bool(const item &)> &filter=return_true< item >, bool player_inv=true, bool npc_query=false, const recipe *rec=nullptr) |
| std::list< item > | consume_items (const comp_selection< item_comp > &is, int batch, const std::function< bool(const item &)> &filter=return_true< item >, bool select_ind=false) |
| std::list< item > | consume_items (map &m, const comp_selection< item_comp > &is, int batch, const std::function< bool(const item &)> &filter=return_true< item >, const std::vector< tripoint > &reachable_pts={}, bool select_ind=false) |
| std::list< item > | consume_items (const std::vector< item_comp > &components, int batch=1, const std::function< bool(const item &)> &filter=return_true< item >, const std::function< bool(const itype_id &)> &select_ind=return_false< itype_id >) |
| bool | consume_software_container (const itype_id &software_id) |
| comp_selection< tool_comp > | select_tool_component (const std::vector< tool_comp > &tools, int batch, read_only_visitable &map_inv, bool can_cancel=false, bool player_inv=true, bool npc_query=false, const std::function< int(int)> &charges_required_modifier=[](int i) { return i;}) |
| bool | craft_consume_tools (item &craft, int multiplier, bool start_craft) |
| Consume tools for the next multiplier * 5% progress of the craft. More... | |
| void | consume_tools (const comp_selection< tool_comp > &tool, int batch) |
| void | consume_tools (map &m, const comp_selection< tool_comp > &tool, int batch, const tripoint &origin=tripoint_zero, int radius=PICKUP_RANGE, basecamp *bcp=nullptr) |
| void | consume_tools (map &m, const comp_selection< tool_comp > &tool, int batch, const std::vector< tripoint > &reachable_pts={}, basecamp *bcp=nullptr) |
| void | consume_tools (const std::vector< tool_comp > &tools, int batch=1) |
| void | check_and_recover_morale () |
| Checks permanent morale for consistency and recovers it when an inconsistency is found. More... | |
| std::pair< int, int > | fun_for (const item &comest, bool ignore_already_ate=false) const |
| Handles the enjoyability value for a comestible. More... | |
| void | suffer () |
| Handles a large number of timers decrementing and other randomized effects. More... | |
| bool | irradiate (float rads, bool bypass=false) |
| Handles mitigation and application of radiation. More... | |
| void | mend (int rate_multiplier) |
| Handles the chance for broken limbs to spontaneously heal to 1 HP. More... | |
| float | get_leak_level () const |
| void | calculate_leak_level () |
| Iterate through the character inventory to get its leak level. More... | |
| void | invalidate_leak_level_cache () |
| Sets leak_level_dirty to true. More... | |
| void | sound_hallu () |
| Creates an auditory hallucination. More... | |
| void | echo_pulse () |
| All nearby obstacles make a very quiet sound. More... | |
| bool | is_driving () const |
| Checks if a Character is driving. More... | |
| void | drench (int saturation, const body_part_set &flags, bool ignore_waterproof) |
| Drenches the player with water, saturation is the percent gotten wet. More... | |
| void | apply_wetness_morale (units::temperature temperature) |
| Recalculates morale penalty/bonus from wetness based on mutations, equipment and temperature. More... | |
| int | heartrate_bpm () const |
| std::vector< std::string > | short_description_parts () const |
| std::string | short_description () const |
| bool | can_hear (const tripoint &source, int volume) const |
| float | hearing_ability () const |
| bool | knows_trap (const tripoint &pos) const |
| void | add_known_trap (const tripoint &pos, const trap &t) |
| bool | sees (const tripoint &t, bool is_avatar=false, int range_mod=0) const override |
| bool | sees (const tripoint_bub_ms &t, bool is_avatar=false, int range_mod=0) const override |
| bool | sees (const Creature &critter) const override |
| int | get_lowest_hp () const |
| bool | has_weapon () const override |
| void | shift_destination (const point &shift) |
| void | set_destination (const std::vector< tripoint_bub_ms > &route, const player_activity &new_destination_activity=player_activity()) |
| void | clear_destination () |
| bool | has_distant_destination () const |
| bool | is_auto_moving () const |
| bool | has_destination () const |
| bool | has_destination_activity () const |
| void | start_destination_activity () |
| std::vector< tripoint_bub_ms > & | get_auto_move_route () |
| action_id | get_next_auto_move_direction () |
| bool | defer_move (const tripoint &next) |
| time_duration | get_consume_time (const item &it) const |
| std::pair< int, int > | weariness_transition_progress () const |
| int | weariness_level () const |
| int | weariness_transition_level () const |
| int | weary_threshold () const |
| int | weariness () const |
| float | activity_level () const |
| float | instantaneous_activity_level () const |
| Returns instantaneous activity level as a float from 0-10 (from game_constants) More... | |
| int | activity_level_index () const |
| Returns instantaneous activity level as an int from 0-5 (half of instantaneous_activity_level) More... | |
| float | exertion_adjusted_move_multiplier (float level=-1.0f) const |
| float | maximum_exertion_level () const |
| std::string | activity_level_str (float level) const |
| std::string | debug_weary_info () const |
| void | add_pain_msg (int, const bodypart_id &) const |
| double | vomit_mod () |
| Returns the modifier value used for vomiting effects. More... | |
| bool | can_sleep () |
| Checked each turn during "lying_down", returns true if the player falls asleep. More... | |
| int | sleep_spot (const tripoint_bub_ms &p) const |
| Rate point's ability to serve as a bed. More... | |
| void | process_effects () override |
| Processes human-specific effects of effects before calling Creature::process_effects(). More... | |
| void | hardcoded_effects (effect &it) |
| Handles the still hard-coded effects. More... | |
| time_duration | estimate_effect_dur (const skill_id &relevant_skill, const efftype_id &effect, const time_duration &error_magnitude, const time_duration &minimum_error, int threshold, const Creature &target) const |
| Estimate effect duration based on player relevant skill. More... | |
| item & | best_item_with_quality (const quality_id &qid) |
| Look for items in the player's inventory that have the specified quality; return the one with highest level. More... | |
| bool | has_quality (const quality_id &qual, int level=1, int qty=1) const override |
| Returns true if instance has amount (or more) items of at least quality level. More... | |
| int | max_quality (const quality_id &qual) const override |
| Return maximum tool quality level provided by instance or INT_MIN if not found. More... | |
| int | max_quality (const quality_id &qual, int radius) const |
| VisitResponse | visit_items (const std::function< VisitResponse(item *, item *)> &func) const override |
| Traverses this object and any child items contained using a visitor pattern. More... | |
| std::list< item > | remove_items_with (const std::function< bool(const item &)> &filter, int count=INT_MAX) override |
| Removes items contained by this instance which match the filter. More... | |
| int | charges_of (const itype_id &what, int limit=INT_MAX, const std::function< bool(const item &)> &filter=return_true< item >, const std::function< void(int)> &visitor=nullptr, bool in_tools=false) const override |
| Count maximum available charges from this instance and any contained items. More... | |
| int | amount_of (const itype_id &what, bool pseudo=true, int limit=INT_MAX, const std::function< bool(const item &)> &filter=return_true< item >) const override |
| Count items matching id including both this instance and any contained items. More... | |
| std::pair< int, int > | kcal_range (const itype_id &id, const std::function< bool(const item &)> &filter, Character &player_character) const |
| int | base_bmr () const |
| void | store (JsonOut &json) const |
| Load variables from json into object. More... | |
| void | load (const JsonObject &data) |
| Gather variables for saving. More... | |
| int | vitamin_RDA (const vitamin_id &vitamin, int ammount) const |
| Returns the % of your RDA that ammount of vitamin represents. More... | |
| void | process_one_effect (effect &it, bool is_new) override |
| Processes human-specific effects of an effect. More... | |
| std::map< bodypart_id, float > | bodypart_exposure () |
| Map body parts to their total exposure, from 0.0 (fully covered) to 1.0 (buck naked). More... | |
| virtual void | mod_speed_bonus (int nspeed) |
| Setters for stats shared with other creatures. More... | |
| virtual void | add_msg_if_player (const std::string &) const |
| virtual void | add_msg_if_player (const game_message_params &, const std::string &) const |
| void | add_msg_if_player (const translation &) const |
| void | add_msg_if_player (const game_message_params &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const translation &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const translation &msg, Args &&... args) const |
| virtual void | add_msg_player_or_npc (const std::string &, const std::string &) const |
| virtual void | add_msg_player_or_npc (const game_message_params &, const std::string &, const std::string &) const |
| void | add_msg_player_or_npc (const translation &, const translation &) const |
| void | add_msg_player_or_npc (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| virtual void | add_msg_player_or_say (const std::string &, const std::string &) const |
| virtual void | add_msg_player_or_say (const game_message_params &, const std::string &, const std::string &) const |
| void | add_msg_player_or_say (const translation &, const translation &) const |
| void | add_msg_player_or_say (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| virtual bool | has_flag (const mon_flag_id &) const |
| This is to prevent clang complaining about overloading a virtual function, the creature version uses monster flags so confusion is unlikely. More... | |
| bool | pour_into (item_location &container, item &liquid, bool ignore_settings) |
| Try to pour the given liquid into the given container/vehicle. More... | |
| bool | pour_into (const vpart_reference &vp, item &liquid) const |
Public Member Functions inherited from Creature | |
| ~Creature () override | |
| virtual bool | is_monster () const |
| virtual avatar * | as_avatar () |
| virtual const avatar * | as_avatar () const |
| virtual monster * | as_monster () |
| virtual const monster * | as_monster () const |
| virtual bool | is_fake () const |
| Returns true for non-real Creatures used temporarily; i.e. More... | |
| virtual void | set_fake (bool fake_value) |
| Sets a Creature's fake boolean. More... | |
| tripoint | pos () const |
| tripoint_bub_ms | pos_bub () const |
| int | posx () const |
| int | posy () const |
| int | posz () const |
| void | setpos (const tripoint &p) |
| void | move_to (const tripoint_abs_ms &loc) |
| Moves the creature to the given location and calls the on_move() handler. More... | |
| virtual void | bleed () const |
| Adds an appropriate blood splatter. More... | |
| bool | sees (const Creature &critter) const override |
| The functions check whether this creature can see the target. More... | |
| bool | sees (const tripoint &t, bool is_avatar=false, int range_mod=0) const override |
| bool | sees (const tripoint_bub_ms &t, bool is_avatar=false, int range_mod=0) const override |
| Creature * | auto_find_hostile_target (int range, int &boo_hoo, int area=0) |
| For fake-players (turrets, mounted turrets) this functions chooses a target. More... | |
| double | ranged_target_size () const |
| Size of the target this creature presents to ranged weapons. More... | |
| void | knock_back_from (const tripoint &p) |
| float | get_crit_factor (const bodypart_id &bp) const |
| int | size_melee_penalty () const |
| virtual int | deal_melee_attack (Creature *source, int hitroll) |
| bool | is_adjacent (const Creature *target, bool allow_z_levels) const |
| virtual void | deal_melee_hit (Creature *source, int hit_spread, bool critical_hit, damage_instance dam, dealt_damage_instance &dealt_dam, const weakpoint_attack &attack=weakpoint_attack(), const bodypart_id *bp=nullptr) |
| virtual void | deal_projectile_attack (Creature *source, dealt_projectile_attack &attack, bool print_messages=true, const weakpoint_attack &wp_attack=weakpoint_attack()) |
| Attempts to harm a creature with a projectile. More... | |
| virtual void | deal_damage_handle_type (const effect_source &source, const damage_unit &du, bodypart_id bp, int &damage, int &pain) |
| void | longpull (const std::string &name, const tripoint &p) |
| Attempts to pull the target at point p towards this creature. More... | |
| bool | dodge_check (float hit_roll, bool force_try=false, float training_level=0.0f) |
| If training_level is anything but 0, the check will only train target's skill to that level. More... | |
| bool | dodge_check (monster *z, float training_level=0.0f) |
| bool | dodge_check (monster *z, bodypart_id bp, const damage_instance &dam_inst, float training_level=0.0f) |
| bool | stumble_invis (const Creature &player, bool stumblemsg=true) |
| bool | attack_air (const tripoint &p) |
| virtual bool | is_ranged_attacker () const |
| Returns true if this monster has a gun-type attack or the RANGED_ATTACKER flag. More... | |
| virtual bool | digging () const |
| bool | cant_do_underwater (bool msg=true) const |
| virtual bool | is_underwater () const |
| bool | is_likely_underwater () const |
| bool | is_dangerous_fields (const field &fld) const |
| Returns true if there is a field in the field set that is dangerous to us. More... | |
| bool | is_dangerous_field (const field_entry &entry) const |
| Returns true if the given field entry is dangerous to us. More... | |
| void | check_dead_state () |
| This function checks the creatures is_dead_state and (if true) calls die. More... | |
| void | add_effect (const effect &eff, bool force=false, bool deferred=false) |
| void | add_effect (const efftype_id &eff_id, const time_duration &dur, bodypart_id bp, bool permanent=false, int intensity=0, bool force=false, bool deferred=false) |
| void | add_effect (const efftype_id &eff_id, const time_duration &dur, bool permanent=false, int intensity=0, bool force=false, bool deferred=false) |
| void | add_effect (const effect_source &source, const effect &eff, bool force=false, bool deferred=false) |
| void | add_effect (const effect_source &source, const efftype_id &eff_id, const time_duration &dur, bodypart_id bp, bool permanent=false, int intensity=0, bool force=false, bool deferred=false) |
| Adds or modifies an effect. More... | |
| void | add_effect (const effect_source &source, const efftype_id &eff_id, const time_duration &dur, bool permanent=false, int intensity=0, bool force=false, bool deferred=false) |
| void | schedule_effect (const effect &eff, bool force=false, bool deferred=false) |
| Schedules a new effect to be applied. More... | |
| void | schedule_effect (const efftype_id &eff_id, const time_duration &dur, bodypart_id bp, bool permanent=false, int intensity=0, bool force=false, bool deferred=false) |
| void | schedule_effect (const efftype_id &eff_id, const time_duration &dur, bool permanent=false, int intensity=0, bool force=false, bool deferred=false) |
| bool | add_env_effect (const efftype_id &eff_id, const bodypart_id &vector, int strength, const time_duration &dur, const bodypart_id &bp, bool permanent=false, int intensity=1, bool force=false) |
| Gives chance to save via environmental resist, returns false if resistance was successful. More... | |
| bool | add_env_effect (const efftype_id &eff_id, const bodypart_id &vector, int strength, const time_duration &dur, bool permanent=false, int intensity=1, bool force=false) |
| bool | remove_effect (const efftype_id &eff_id, const bodypart_id &bp) |
| Removes a listed effect. More... | |
| bool | remove_effect (const efftype_id &eff_id) |
| void | schedule_effect_removal (const efftype_id &eff_id, const bodypart_id &bp) |
| Schedule effect removal. More... | |
| void | schedule_effect_removal (const efftype_id &eff_id) |
| void | clear_effects () |
| Remove all effects. More... | |
| bool | has_effect (const efftype_id &eff_id, const bodypart_id &bp) const |
| Check if creature has the matching effect. More... | |
| bool | has_effect (const efftype_id &eff_id) const |
| bool | has_effect_with_flag (const flag_id &flag, const bodypart_id &bp) const |
| Check if creature has any effect with the given flag. More... | |
| bool | has_effect_with_flag (const flag_id &flag) const |
| std::vector< std::reference_wrapper< const effect > > | get_effects_with_flag (const flag_id &flag) const |
| std::vector< std::reference_wrapper< const effect > > | get_effects_from_bp (const bodypart_id &bp) const |
| std::vector< std::reference_wrapper< const effect > > | get_effects () const |
| const effect & | get_effect (const efftype_id &eff_id, const bodypart_id &bp=bodypart_str_id::NULL_ID()) const |
| Return the effect that matches the given arguments exactly. More... | |
| effect & | get_effect (const efftype_id &eff_id, const bodypart_id &bp=bodypart_str_id::NULL_ID()) |
| time_duration | get_effect_dur (const efftype_id &eff_id, const bodypart_id &bp=bodypart_str_id::NULL_ID()) const |
| Returns the duration of the matching effect. More... | |
| int | get_effect_int (const efftype_id &eff_id, const bodypart_id &bp=bodypart_str_id::NULL_ID()) const |
| Returns the intensity of the matching effect. More... | |
| bool | resists_effect (const effect &e) const |
| Returns true if the creature resists an effect. More... | |
| void | set_value (const std::string &key, const std::string &value) |
| void | remove_value (const std::string &key) |
| std::string | get_value (const std::string &key) const |
| std::optional< std::string > | maybe_get_value (const std::string &key) const |
| void | clear_values () |
| virtual void | mod_pain_noresist (int npain) |
| virtual int | get_pain () const |
| int | get_moves () const |
| void | mod_moves (int nmoves) |
| void | set_moves (int nmoves) |
| virtual Creature * | get_killer () const |
| virtual int | get_num_blocks () const |
| virtual int | get_num_dodges () const |
| virtual int | get_num_blocks_bonus () const |
| virtual int | get_num_dodges_bonus () const |
| virtual int | get_num_dodges_base () const |
| virtual int | get_num_blocks_base () const |
| virtual int | get_armor_res (const damage_type_id &dt, bodypart_id bp) const |
| virtual int | get_armor_res_base (const damage_type_id &dt, bodypart_id bp) const |
| virtual int | get_armor_res_bonus (const damage_type_id &dt) const |
| virtual float | get_hit () const |
| virtual int | get_hp (const bodypart_id &bp) const |
| virtual int | get_hp () const |
| virtual int | get_hp_max (const bodypart_id &bp) const |
| virtual int | get_hp_max () const |
| virtual bool | has_flag (const mon_flag_id &) const |
| void | set_reachable_zone (int zone) |
| int | get_reachable_zone () const |
| anatomy_id | get_anatomy () const |
| void | set_anatomy (const anatomy_id &anat) |
| bodypart_id | get_random_body_part (bool main=false) const |
| std::vector< bodypart_id > | get_all_body_parts (get_body_part_flags=get_body_part_flags::none) const |
| Returns body parts this creature have. More... | |
| std::vector< bodypart_id > | get_all_body_parts_of_type (body_part_type::type part_type, get_body_part_flags flags=get_body_part_flags::none) const |
| bodypart_id | get_random_body_part_of_type (body_part_type::type part_type) const |
| bodypart_id | get_root_body_part () const |
| std::vector< bodypart_id > | get_all_body_parts_with_flag (const json_character_flag &flag) const |
| body_part_set | get_drenching_body_parts (bool upper=true, bool mid=true, bool lower=true) const |
| int | get_num_body_parts_of_type (body_part_type::type part_type) const |
| int | get_num_broken_body_parts_of_type (body_part_type::type part_type) const |
| const std::map< bodypart_str_id, bodypart > & | get_body () const |
| void | set_body () |
| bool | has_part (const bodypart_id &id, body_part_filter filter=body_part_filter::strict) const |
| bodypart * | get_part (const bodypart_id &id) |
| const bodypart * | get_part (const bodypart_id &id) const |
| bodypart_id | get_part_id (const bodypart_id &id, body_part_filter filter=body_part_filter::next_best, bool suppress_debugmsg=false) const |
| int | get_part_hp_cur (const bodypart_id &id) const |
| int | get_part_hp_max (const bodypart_id &id) const |
| int | get_part_healed_total (const bodypart_id &id) const |
| int | get_part_damage_disinfected (const bodypart_id &id) const |
| int | get_part_damage_bandaged (const bodypart_id &id) const |
| int | get_part_drench_capacity (const bodypart_id &id) const |
| int | get_part_wetness (const bodypart_id &id) const |
| units::temperature | get_part_temp_cur (const bodypart_id &id) const |
| units::temperature | get_part_temp_conv (const bodypart_id &id) const |
| int | get_part_frostbite_timer (const bodypart_id &id) const |
| std::array< int, NUM_WATER_TOLERANCE > | get_part_mut_drench (const bodypart_id &id) const |
| float | get_part_wetness_percentage (const bodypart_id &id) const |
| const encumbrance_data & | get_part_encumbrance_data (const bodypart_id &id) const |
| void | set_part_hp_max (const bodypart_id &id, int set) |
| void | set_part_healed_total (const bodypart_id &id, int set) |
| void | set_part_damage_disinfected (const bodypart_id &id, int set) |
| void | set_part_damage_bandaged (const bodypart_id &id, int set) |
| void | set_part_encumbrance_data (const bodypart_id &id, const encumbrance_data &set) |
| void | set_part_wetness (const bodypart_id &id, int set) |
| void | set_part_temp_cur (const bodypart_id &id, units::temperature set) |
| void | set_part_temp_conv (const bodypart_id &id, units::temperature set) |
| void | set_part_frostbite_timer (const bodypart_id &id, int set) |
| void | set_part_mut_drench (const bodypart_id &id, std::pair< water_tolerance, int > set) |
| void | mod_part_hp_max (const bodypart_id &id, int mod) |
| void | mod_part_healed_total (const bodypart_id &id, int mod) |
| void | mod_part_damage_disinfected (const bodypart_id &id, int mod) |
| void | mod_part_damage_bandaged (const bodypart_id &id, int mod) |
| void | mod_part_wetness (const bodypart_id &id, int mod) |
| void | mod_part_temp_cur (const bodypart_id &id, units::temperature_delta mod) |
| void | mod_part_temp_conv (const bodypart_id &id, units::temperature_delta mod) |
| void | mod_part_frostbite_timer (const bodypart_id &id, int mod) |
| void | set_all_parts_temp_cur (units::temperature set) |
| void | set_all_parts_temp_conv (units::temperature set) |
| void | set_all_parts_wetness (int set) |
| void | set_all_parts_hp_cur (int set) |
| void | set_all_parts_hp_to_max () |
| bool | has_atleast_one_wet_part () const |
| bool | is_part_at_max_hp (const bodypart_id &id) const |
| virtual int | get_speed_base () const |
| virtual int | get_speed_bonus () const |
| virtual int | get_block_bonus () const |
| virtual int | get_bash_bonus () const |
| virtual int | get_cut_bonus () const |
| virtual float | get_dodge_bonus () const |
| virtual float | get_hit_bonus () const |
| virtual float | get_bash_mult () const |
| virtual float | get_cut_mult () const |
| virtual bool | get_melee_quiet () const |
| virtual int | get_throw_resist () const |
| virtual void | set_num_blocks_bonus (int nblocks) |
| virtual void | mod_num_blocks_bonus (int nblocks) |
| virtual void | mod_num_dodges_bonus (int ndodges) |
| virtual void | set_armor_res_bonus (int narm, const damage_type_id &dt) |
| virtual void | set_speed_base (int nspeed) |
| virtual void | set_speed_bonus (int nspeed) |
| virtual void | set_block_bonus (int nblock) |
| virtual void | set_bash_bonus (int nbash) |
| virtual void | set_cut_bonus (int ncut) |
| virtual void | mod_speed_bonus (int nspeed) |
| virtual void | mod_block_bonus (int nblock) |
| virtual void | mod_bash_bonus (int nbash) |
| virtual void | mod_cut_bonus (int ncut) |
| virtual void | mod_size_bonus (int nsize) |
| virtual void | set_dodge_bonus (float ndodge) |
| virtual void | set_hit_bonus (float nhit) |
| virtual void | mod_dodge_bonus (float ndodge) |
| virtual void | mod_hit_bonus (float nhit) |
| virtual void | set_bash_mult (float nbashmult) |
| virtual void | set_cut_mult (float ncutmult) |
| virtual void | set_melee_quiet (bool nquiet) |
| virtual void | set_throw_resist (int nthrowres) |
| void | draw (const catacurses::window &w, const point &origin, bool inverted) const |
| void | draw (const catacurses::window &w, const tripoint &origin, bool inverted) const |
| void | describe_infrared (std::vector< std::string > &buf) const |
| Describe this creature as seen by the avatar via infrared vision. More... | |
| void | describe_specials (std::vector< std::string > &buf) const |
| Describe this creature as detected by the avatar's special senses. More... | |
| void | add_msg_if_player (const translation &) const |
| void | add_msg_if_player (const game_message_params &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const translation &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_player (const game_message_params ¶ms, const translation &msg, Args &&... args) const |
| void | add_msg_if_npc (const translation &) const |
| void | add_msg_if_npc (const game_message_params &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const translation &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const game_message_params ¶ms, const char *const msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const game_message_params ¶ms, const std::string &msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_if_npc (const game_message_params ¶ms, const translation &msg, Args &&... args) const |
| void | add_msg_player_or_npc (const translation &, const translation &) const |
| void | add_msg_player_or_npc (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const char *const player_msg, const char *const npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_msg, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_npc (const game_message_params ¶ms, const translation &player_msg, const translation &npc_msg, Args &&... args) const |
| void | add_msg_player_or_say (const translation &, const translation &) const |
| void | add_msg_player_or_say (const game_message_params &, const translation &, const translation &) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const char *const player_msg, const char *const npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const std::string &player_msg, const std::string &npc_speech, Args &&... args) const |
| template<typename ... Args> | |
| void | add_msg_player_or_say (const game_message_params ¶ms, const translation &player_msg, const translation &npc_speech, Args &&... args) const |
| virtual bool | is_symbol_highlighted () const |
| std::unordered_map< std::string, std::string > & | get_values () |
| void | clear_killer () |
| void | set_summon_time (const time_duration &length) |
| void | decrement_summon_timer () |
| void | set_summoner (Creature *summoner) |
| void | set_summoner (character_id summoner) |
| Creature * | get_summoner () const |
| bodypart_id | get_max_hitsize_bodypart () const |
| bodypart_id | select_body_part (int min_hit, int max_hit, bool can_attack_high, int hit_roll) const |
| bodypart_id | select_blocking_part (bool arm, bool leg, bool nonstandard) const |
| bodypart_id | random_body_part (bool main_parts_only=false) const |
| std::vector< bodypart_id > | get_all_eligable_parts (int min_hit, int max_hit, bool can_attack_high) const |
| void | add_damage_over_time (const damage_over_time_data &DoT) |
| void | process_damage_over_time () |
| std::string | replace_with_npc_name (std::string input) const |
| This function replaces the "<npcname>" substring with the disp_name of this creature. More... | |
| tripoint_abs_ms | get_location () const |
| Returns the location of the creature in map square coordinates (the most detailed coordinate system), relative to a fixed global point of origin. More... | |
| tripoint_abs_sm | global_sm_location () const |
| Returns the location of the creature in global submap coordinates. More... | |
| tripoint_abs_omt | global_omt_location () const |
| Returns the location of the creature in global overmap terrain coordinates. More... | |
Public Member Functions inherited from viewer | |
| virtual | ~viewer ()=default |
Public Member Functions inherited from visitable | |
| item | remove_item (item &it) |
| Removes and returns the item which must be contained by this instance. More... | |
Public Member Functions inherited from read_only_visitable | |
| item * | find_parent (const item &it) const |
| Determine the immediate parent container (if any) for an item. More... | |
| std::vector< item * > | parents (const item &it) const |
| Returns vector of parent containers (if any) starting with the innermost. More... | |
| bool | has_item (const item &it) const |
| Returns true if this visitable instance contains the item. More... | |
| bool | has_item_with (const std::function< bool(const item &)> &filter) const |
| Returns true if any item (including those within a container) matches the filter. More... | |
| std::pair< int, int > | kcal_range (const itype_id &id, const std::function< bool(const item &)> &filter, Character &player_character) const |
| bool | has_amount (const itype_id &what, int qty, bool pseudo=true, const std::function< bool(const item &)> &filter=return_true< item >) const |
| Check instance provides at least qty of an item (. More... | |
| std::vector< item * > | items_with (const std::function< bool(const item &)> &filter) |
| Returns all items (including those within a container) matching the filter. More... | |
| std::vector< const item * > | items_with (const std::function< bool(const item &)> &filter) const |
| virtual | ~read_only_visitable ()=default |
| bool | has_tools (const itype_id &it, int quantity, const std::function< bool(const item &)> &filter=return_true< item >) const |
| bool | has_components (const itype_id &it, int quantity, const std::function< bool(const item &)> &filter=return_true< item >) const |
Static Public Member Functions | |
| static std::string | get_need_str_id (const npc_need &need) |
| static overmap_location_str_id | get_location_for (const npc_need &need) |
| static bool | theft_witness_compare (const npc *lhs, const npc *rhs) |
Static Public Member Functions inherited from Character | |
| static int | thirst_speed_penalty (int thirst) |
| Returns the penalty to speed from thirst. More... | |
| static int | worn_position_to_index (int position) |
| static units::temperature_delta | floor_bedding_warmth (const tripoint &pos) |
| Warmth from terrain, furniture, vehicle furniture and traps. More... | |
| static units::temperature_delta | floor_item_warmth (const tripoint &pos) |
| Warmth from clothing on the floor. More... | |
| static int | min_height (creature_size size_category=creature_size::medium) |
| Min, max and default heights for each size category of a character in centimeters. More... | |
| static int | default_height (creature_size size_category=creature_size::medium) |
| static int | max_height (creature_size size_category=creature_size::medium) |
Static Public Member Functions inherited from Creature | |
| static std::string | attitude_raw_string (Attitude att) |
| Simplified attitude string for unlocalized needs. More... | |
| static const std::pair< translation, nc_color > & | get_attitude_ui_data (Attitude att) |
| Creature Attitude as String and color. More... | |
| static void | load_hit_range (const JsonObject &) |
Static Public Attributes | |
| static std::array< std::pair< std::string, overmap_location_str_id >, npc_need::num_needs > | need_data |
| static constexpr tripoint_abs_omt | no_goal_point { tripoint_min } |
Static Public Attributes inherited from Character | |
| static const std::vector< material_id > | fleshy = { material_flesh, material_hflesh } |
Static Public Attributes inherited from Creature | |
| static const std::map< std::string, creature_size > | size_map |
| static const std::set< material_id > | cmat_flesh |
| static const std::set< material_id > | cmat_fleshnveg |
| static const std::set< material_id > | cmat_flammable |
| static const std::set< material_id > | cmat_flameres |
| static std::vector< int > | dispersion_for_even_chance_of_good_hit |
Protected Member Functions | |
| void | store (JsonOut &json) const |
| void | load (const JsonObject &data) |
| void | on_move (const tripoint_abs_ms &old_pos) override |
Protected Member Functions inherited from Character | |
| void | mod_stored_calories (int ncal, bool ignore_weariness=false) |
| void | set_stored_calories (int cal) |
| float | generic_weakpoint_skill (skill_id skill_1, skill_id skill_2, limb_score_id limb_score_1, limb_score_id limb_score_2) const |
| void | set_mutation_unsafe (const trait_id &, const mutation_variant *=nullptr) |
| void | do_skill_rust () |
| void | apply_mods (const trait_id &mut, bool add_remove) |
| Applies stat mods to character. More... | |
| void | mut_cbm_encumb (std::map< bodypart_id, encumbrance_data > &vals) const |
| Applies encumbrance from mutations and bionics only. More... | |
| void | apply_mut_encumbrance (std::map< bodypart_id, encumbrance_data > &vals) const |
| void | calc_bmi_encumb (std::map< bodypart_id, encumbrance_data > &vals) const |
| Applies encumbrance from BMI. More... | |
| void | calc_bmi_encumb () const |
| void | on_damage_of_type (const effect_source &source, int adjusted_damage, const damage_type_id &dt, const bodypart_id &bp) override |
| recipe_subset | get_available_recipes (const inventory &crafting_inv, const std::vector< Character * > *helpers=nullptr) const |
| Return all available recipes (from books and companions) More... | |
| Character () | |
| Character (Character &&) noexcept(map_is_noexcept) | |
| Character & | operator= (Character &&) noexcept(list_is_noexcept) |
| void | swap_character (Character &other) |
Protected Member Functions inherited from Creature | |
| void | set_pos_only (const tripoint &p) |
| void | set_location (const tripoint_abs_ms &loc) |
| void | set_killer (Creature *killer) |
| Creature () | |
| Creature (const Creature &) | |
| Creature (Creature &&) noexcept(map_is_noexcept) | |
| Creature & | operator= (const Creature &) |
| Creature & | operator= (Creature &&) noexcept |
| void | store (JsonOut &jsout) const |
| These two functions are responsible for storing and loading the members of this class to/from json data. More... | |
| void | load (const JsonObject &jsin) |
Private Member Functions | |
| void | import_and_clean (const JsonObject &data) |
| bool | sees_dangerous_field (const tripoint &p) const |
| bool | could_move_onto (const tripoint &p) const |
| bool | could_move_onto (const tripoint_bub_ms &p) const |
| std::vector< sphere > | find_dangerous_explosives () const |
Private Attributes | |
| npc_attitude | attitude = NPCATT_NULL |
| npc_attitude | previous_attitude = NPCATT_NULL |
| bool | known_to_u = false |
| std::map< std::string, time_point > | complaints |
| npc_short_term_cache | ai_cache |
| std::map< npc_need, npc_need_goal_cache > | goal_cache |
| item | real_weapon |
| int | cbm_weapon_index = -1 |
| bool | dead = false |
| bool | prevent_death_reminder = false |
| npc_companion_mission | comp_mission |
| std::string | unique_id |
Additional Inherited Members | |
Public Types inherited from Character | |
| enum class | comfort_level : int { impossible = -999 , uncomfortable = -7 , neutral = 0 , slightly_comfortable = 3 , comfortable = 5 , very_comfortable = 10 } |
| using | cached_moncam = std::pair< monster const *, tripoint_abs_ms > |
| using | moncam_cache_t = cata::flat_set< cached_moncam > |
| using | trap_map = std::map< tripoint, std::string > |
Public Types inherited from Creature | |
| enum class | Attitude : int { HOSTILE , NEUTRAL , FRIENDLY , ANY } |
| Simplified attitude towards any creature: hostile - hate, want to kill, etc. More... | |
Protected Attributes inherited from Character | |
| int | focus_pool = 0 |
| std::set< mtype_id > | known_monsters |
| bionic_uid | weapon_bionic_uid = 0 |
| bionic_uid | next_bionic_uid = 0 |
| pimpl< recipe_subset > | learned_recipes |
| Subset of learned recipes. More... | |
| decltype(_skills) | valid_autolearn_skills |
| Stamp of skills. More... | |
| std::unordered_map< point_abs_omt, time_duration > | overmap_time |
| Amount of time the player has spent in each overmap tile. More... | |
Protected Attributes inherited from Creature | |
| anatomy_id | creature_anatomy = anatomy_id( "default_anatomy" ) |
| anatomy is the plan of the creature's body More... | |
| std::map< bodypart_str_id, bodypart > | body |
| this is the actual body of the creature More... | |
| int | moves |
| Creature * | killer |
| std::optional< time_point > | lifespan_end = std::nullopt |
| std::optional< character_id > | summoner = std::nullopt |
| pimpl< effects_map > | effects |
| std::queue< scheduled_effect, std::list< scheduled_effect > > | scheduled_effects |
| std::queue< terminating_effect, std::list< terminating_effect > > | terminating_effects |
| std::vector< damage_over_time_data > | damage_over_time_map |
| std::unordered_map< std::string, std::string > | values |
| int | num_blocks = 0 |
| int | num_dodges = 0 |
| int | num_blocks_bonus = 0 |
| int | num_dodges_bonus = 0 |
| std::map< damage_type_id, float > | armor_bonus |
| int | speed_base = 0 |
| int | speed_bonus = 0 |
| float | dodge_bonus = 0.0f |
| int | block_bonus = 0 |
| float | hit_bonus = 0.0f |
| int | bash_bonus = 0 |
| int | cut_bonus = 0 |
| int | size_bonus = 0 |
| float | bash_mult = 0.0f |
| float | cut_mult = 0.0f |
| bool | melee_quiet = false |
| int | throw_resist = 0 |
| time_point | last_updated |
| bool | fake = false |
Related Functions inherited from visitable | |
| item * | find_parent (const item &it) const |
| std::vector< item * > | parents (const item &it) const |
| bool | has_item (const item &it) const |
| bool | has_item_with (const std::function< bool(const item &)> &filter) const |
| bool | has_quality (const quality_id &qual, int level, int qty) const |
| Returns true if instance has amount (or more) items of at least quality level. More... | |
| int | max_quality (const quality_id &qual) const |
| Return maximum tool quality level provided by instance or INT_MIN if not found. More... | |
| std::vector< const item * > | items_with (const std::function< bool(const item &)> &filter) const |
| std::vector< item * > | items_with (const std::function< bool(const item &)> &filter) |
| VisitResponse | visit_items (const std::function< VisitResponse(item *, item *)> &func) const |
| Traverses this object and any child items contained using a visitor pattern. More... | |
| std::list< item > | remove_items_with (const std::function< bool(const item &e)> &filter, int count) |
| int | charges_of (const itype_id &what, int limit, const std::function< bool(const item &)> &filter, const std::function< void(int)> &visitor, bool in_tools) const |
| Count maximum available charges from this instance and any contained items. More... | |
| int | amount_of (const itype_id &what, bool pseudo, int limit, const std::function< bool(const item &)> &filter) const |
| Count items matching id including both this instance and any contained items. More... | |
| bool | has_amount (const itype_id &what, int qty, bool pseudo, const std::function< bool(const item &)> &filter) const |
| npc::npc | ( | ) |
Definition at line 218 of file npc.cpp.
References ai_cache, attitude, dead, Character::death_drops, Character::dex_max, Character::fac_id, fetching_item, goal, guard_pos, hallucination, has_new_items, hit_by_player, idz, Character::int_max, last_player_seen_pos, last_seen_player_turn, Creature::last_updated, marked_for_death, Creature::moves, myclass, NPC_MISSION_NULL, npc_threat_dir, NPCATT_NULL, string_id< T >::NULL_ID(), string_id< faction >::NULL_ID(), string_id< npc_class >::NULL_ID(), Character::path_settings, patience, Character::per_max, Character::str_max, npc_short_term_cache::threat_map, tripoint_min, calendar::turn, wanted_item_pos, and worst_item_value.
|
delete |
|
defaultnoexcept |
|
overridedefault |
| void npc::act_on_danger_assessment | ( | ) |
Definition at line 1101 of file npcmove.cpp.
References _, Creature::add_effect(), add_msg(), add_msg_debug, npc_combat_memory_cache::assess_ally, npc_combat_memory_cache::assess_enemy, npc_combat_memory_cache::assessment_before_repos, npc_personality::bravery, debugmode::DF_NPC_COMBATAI, effect_npc_fire_bad, effect_npc_run_away, npc_combat_memory_cache::failing_to_reposition, Creature::get_pain(), Character::get_per(), get_player_character(), Character::get_wielded_item(), Creature::has_effect(), item::is_gun(), is_player_ally(), m_bad, max(), mem_combat, min(), Character::name, one_in(), npc_combat_memory_cache::panic, path, personality, Creature::pos(), Creature::remove_effect(), npc_combat_memory_cache::reposition_countdown, npc_combat_memory_cache::repositioning, rl_dist(), rng(), round(), Character::sees(), npc_combat_memory_cache::swarm_count, and warn_about().
Referenced by move().
| bool npc::activate_bionic_by_id | ( | const bionic_id & | cbm_id, |
| bool | eff_only = false |
||
| ) |
Definition at line 2234 of file npcmove.cpp.
References Character::activate_bionic(), and Character::my_bionics.
Referenced by activate_combat_cbms(), address_needs(), complain(), execute_action(), move_pause(), and npc_attack_melee::use().
| void npc::activate_combat_cbms | ( | ) |
Definition at line 2209 of file npcmove.cpp.
References activate_bionic_by_id(), can_use_offensive_cbm(), check_or_use_weapon_cbm(), anonymous_namespace{npcmove.cpp}::defense_cbms, and anonymous_namespace{npcmove.cpp}::weapon_cbms.
Referenced by prepare_for_combat().
| void npc::activate_combat_items | ( | ) |
Definition at line 2344 of file npcmove.cpp.
References outfit::activate_combat_items(), and Character::worn.
Referenced by prepare_for_combat().
| void npc::activate_item | ( | item & | it | ) |
Definition at line 4314 of file npcmove.cpp.
References itype::invoke(), item::is_food(), item::is_tool(), Creature::moves, Creature::pos(), and item::type.
Referenced by alt_attack(), and npc_attack_activate_item::use().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 3026 of file npc.cpp.
References add_msg(), and Creature::replace_with_npc_name().
|
overridevirtual |
Reimplemented from Creature.
Definition at line 3015 of file npc.cpp.
References add_msg(), and Creature::replace_with_npc_name().
Referenced by outfit::activate_combat_items(), outfit::deactivate_combat_items(), move_to(), set_attitude(), stow_item(), and wield().
|
inline |
Definition at line 753 of file creature.h.
|
inline |
Definition at line 753 of file creature.h.
|
inlineoverridevirtual |
| void Creature::add_msg_if_player |
Definition at line 753 of file creature.cpp.
|
inline |
Definition at line 753 of file creature.h.
|
override |
Definition at line 755 of file character.cpp.
|
inline |
Definition at line 753 of file creature.h.
|
inline |
Definition at line 753 of file creature.h.
|
inline |
Definition at line 753 of file creature.h.
|
inlineoverridevirtual |
|
override |
Definition at line 754 of file character.cpp.
|
inline |
Definition at line 753 of file creature.h.
| void Creature::add_msg_if_player |
Definition at line 753 of file creature.cpp.
|
inline |
Definition at line 753 of file creature.h.
|
inline |
Definition at line 756 of file creature.h.
|
inline |
Definition at line 756 of file creature.h.
| void Creature::add_msg_player_or_npc |
Definition at line 756 of file creature.cpp.
|
inline |
Definition at line 756 of file creature.h.
|
override |
Definition at line 759 of file character.cpp.
|
overridevirtual |
Reimplemented from Character.
Definition at line 3031 of file npc.cpp.
References add_msg(), get_player_view(), Creature::replace_with_npc_name(), and Character::sees().
|
inline |
Definition at line 756 of file creature.h.
|
inline |
Definition at line 756 of file creature.h.
|
inline |
Definition at line 756 of file creature.h.
|
overridevirtual |
Reimplemented from Character.
Definition at line 3020 of file npc.cpp.
References add_msg_if_player_sees(), and Creature::replace_with_npc_name().
|
inline |
Definition at line 756 of file creature.h.
|
override |
Definition at line 757 of file character.cpp.
References fd_blood_veggy.
| void Creature::add_msg_player_or_npc |
Definition at line 756 of file creature.cpp.
|
inline |
Definition at line 756 of file creature.h.
|
inline |
Definition at line 761 of file creature.h.
|
inline |
Definition at line 761 of file creature.h.
| void Creature::add_msg_player_or_say |
Definition at line 761 of file creature.cpp.
|
inline |
Definition at line 761 of file creature.h.
|
override |
Definition at line 764 of file character.cpp.
|
overridevirtual |
|
inline |
Definition at line 761 of file creature.h.
|
inline |
Definition at line 761 of file creature.h.
|
inline |
|
override |
Definition at line 762 of file character.cpp.
|
overridevirtual |
|
inline |
Definition at line 761 of file creature.h.
| void Creature::add_msg_player_or_say |
Definition at line 761 of file creature.cpp.
|
inline |
Definition at line 761 of file creature.h.
| void npc::add_new_mission | ( | mission * | miss | ) |
See dialogue_chatbin::add_new_mission.
Definition at line 3052 of file npc.cpp.
References dialogue_chatbin::add_new_mission(), and chatbin.
Referenced by debug_menu::character_edit_menu(), talk_function::clear_mission(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_offer_mission(), load_npc_template(), and game::reset_npc_dispositions().
| npc_action npc::address_needs | ( | ) |
Definition at line 2038 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::danger.
Referenced by avoid_friendly_fire(), and move().
| npc_action npc::address_needs | ( | float | danger | ) |
Definition at line 2418 of file npcmove.cpp.
References ACT_PULP, activate_bionic_by_id(), Character::activity, add_msg_debug, adjust_worn(), ai_cache, allow_sleep, npc_short_term_cache::ally, healing_options::any_true(), Character::assign_activity(), bio_nanobots, bio_painkiller, can_do_pulp(), npc_short_term_cache::can_heal, can_reload_current(), consume_food(), consume_food_from_camp(), deactivate_bionic_by_id(), debugmode::DF_NPC_ITEMAI, die(), do_reload(), find_corpse_to_pulp(), find_reloadable(), g, stomach_contents::get_calories(), Character::get_healthy_kcal(), Character::get_hunger(), Character::get_perceived_pain(), get_player_character(), Character::get_skill_level(), Character::get_sleepiness(), Character::get_stored_kcal(), get_thirst(), npc_follower_rules::has_flag(), has_healing_options(), has_painkiller(), Character::in_sleep_state(), calendar::INDEFINITELY_LONG, is_hallucination(), is_player_ally(), is_walking_with(), MASSIVE_SLEEPINESS, move_to_next(), Character::name, NPC_DANGER_VERY_LOW, npc_heal, npc_heal_player, NPC_HUNGER_CONSUME, npc_noop, npc_player_activity, npc_reload, npc_sleep, NPC_THIRST_CONSUME, npc_undecided, npc_use_painkiller, one_in(), patient_assessment(), player_activity::placement, Creature::posz(), pulp_location, recharge_cbm(), rules, Character::sees(), Character::set_sleepiness(), skill_firstaid, Character::stomach, TIRED, took_painkiller(), use_bionic_by_id(), and wants_to_recharge_cbm().
| npc_action npc::address_player | ( | ) |
Definition at line 2570 of file npcmove.cpp.
References Creature::add_effect(), attitude, chat_snippets(), effect_catch_up, Creature::get_effect_int(), get_player_character(), has_omt_destination(), Character::in_sleep_state(), npc_flee, npc_follow_player, npc_goto_destination, npc_mug_player, npc_noop, npc_pause, npc_talk_to_player, npc_undecided, NPCATT_FLEE_TEMP, NPCATT_KILL, NPCATT_LEAD, NPCATT_MUG, NPCATT_NULL, NPCATT_RECOVER_GOODS, NPCATT_TALK, NPCATT_WAIT_FOR_LEAVE, one_in(), patience, Creature::pos(), rl_dist(), say(), Character::sees(), and set_attitude().
Referenced by move().
| bool npc::adjust_worn | ( | ) |
Definition at line 5393 of file npcmove.cpp.
References outfit::adjust_worn(), bp, Creature::get_all_body_parts(), Character::is_limb_broken(), and Character::worn.
Referenced by address_needs().
| void npc::aim | ( | const Target_attributes & | target_attributes | ) |
Definition at line 2798 of file npcmove.cpp.
References Character::aim_per_move(), Character::gen_aim_mods_cache(), Character::get_wielded_item(), max(), Creature::moves, Character::recoil, and Character::weapon.
Referenced by execute_action(), move_pause(), and npc_attack_gun::use().
| bool npc::alt_attack | ( | ) |
Definition at line 4176 of file npcmove.cpp.
References activate_item(), item::active, ai_cache, avoid_friendly_fire(), confident_throw_range(), creature_tracker::creature_at(), current_target(), debugmsg, flag_NPC_ACTIVATE, flag_NPC_ALT_ATTACK, flag_NPC_THROW_NOW, g, get_creature_tracker(), get_map(), Character::get_wielded_item(), npc_follower_rules::has_flag(), item::has_flag(), is_hallucination(), is_player_ally(), visitable::items_with(), move_pause(), move_to_next(), npc_throw(), one_in(), map::points_in_radius(), Creature::pos(), rl_dist(), rules, npc_short_term_cache::target, Character::throw_range(), update_path(), use_grenades, and wont_hit_friend().
| void npc::apply_ownership_to_inv | ( | ) |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Reimplemented from Creature.
Definition at line 808 of file npc.h.
Referenced by item::handle_pickup_ownership(), vehicle::handle_potential_theft(), and game::npc_menu().
| void npc::assess_danger | ( | ) |
Definition at line 707 of file npcmove.cpp.
References Creature::add_effect(), add_msg_debug, ai_cache, ALL, npc_combat_memory_cache::assess_ally, npc_combat_memory_cache::assess_enemy, attitude_to(), average_damage_dealt(), npc_personality::bravery, c, Character::clairvoyance(), clear_shot_reach(), CLOSE, confident_range_cache, npc_short_term_cache::danger, npc_short_term_cache::danger_assessment, debugmode::DF_NPC, debugmode::DF_NPC_COMBATAI, direction_from(), effect_hit_by_player, effect_npc_fire_bad, effect_npc_run_away, npc_follower_rules::engagement, npc_combat_memory_cache::engagement_distance, evaluate_character(), evaluate_monster(), evaluate_self(), fd_fire, follow_close, follow_distance(), forbid_engage, FREE_FIRE, Creature::FRIENDLY, npc_short_term_cache::friends, g, map::get_field(), get_map(), get_player_character(), Character::get_speed(), Character::get_wielded_item(), Creature::has_effect(), has_faction_relationship(), npc_follower_rules::has_flag(), map::has_flag(), map::has_potential_los(), HIT, Creature::HOSTILE, npc_short_term_cache::hostile_guys, invalidate_range_cache(), is_enemy(), is_friendly(), is_guarding(), item::is_gun(), Character::is_npc(), is_player_ally(), max(), mem_combat, min(), npc_combat_memory_cache::my_health, Character::name, Creature::NEUTRAL, npc_short_term_cache::neutral_guys, NO_MOVE, NONE, NPC_COWARDICE_MODIFIER, NPC_DANGER_VERY_LOW, NPC_MONSTER_DANGER_MAX, npc_threat_dir, one_in(), npc_combat_memory_cache::panic, path, personality, map::points_in_radius(), Creature::pos(), rl_dist(), rng(), rules, Character::sees(), npc_combat_memory_cache::swarm_count, npc_short_term_cache::target, TFLAG_FIRE_CONTAINER, npc_short_term_cache::threat_map, too_close(), npc_short_term_cache::total_danger, translate_marker, warn_about(), npc_factions::watch_your_back, and WEAK.
Referenced by regen_ai_cache().
| int npc::assigned_missions_value | ( | ) |
Definition at line 1661 of file npc.cpp.
References chatbin, mission::get_value(), dialogue_chatbin::missions_assigned, and cata::hash64_detail::ret.
Referenced by talker_npc::parse_mod().
|
overridevirtual |
Attitude (of this creature) towards another creature.
This might not be symmetric.
Reimplemented from Character.
Definition at line 2386 of file npc.cpp.
References ai_cache, monster::attitude(), Character::attitude_to(), Creature::FRIENDLY, npc_short_term_cache::friends, get_player_character(), has_faction_relationship(), monster::has_flag(), Creature::HOSTILE, npc_short_term_cache::hostile_guys, is_enemy(), is_player_ally(), npc_factions::kill_on_sight, MATT_ATTACK, MATT_FLEE, MATT_FOLLOW, MATT_FPASSIVE, MATT_FRIEND, MATT_IGNORE, MATT_NULL, mon_flag_HIT_AND_RUN, Creature::NEUTRAL, neutral, npc_short_term_cache::neutral_guys, NUM_MONSTER_ATTITUDES, other, and npc_factions::watch_your_back.
Referenced by npc_attack_melee::all_evaluations(), npc_attack_throw::all_evaluations(), assess_danger(), npc_attack_melee::evaluate(), npc_attack_throw::evaluate(), npc_attack_spell::evaluate_tripoint(), npc_attack_gun::evaluate_tripoint(), npc_attack_throw::evaluate_tripoint(), game::mon_info_update(), move_to(), print_info(), and npc_attack_melee::use().
| float npc::average_damage_dealt | ( | ) |
Definition at line 2506 of file npc.cpp.
References Character::get_wielded_item(), Character::melee_value(), and null_item_reference().
Referenced by assess_danger().
| void npc::avoid_friendly_fire | ( | ) |
Definition at line 3167 of file npcmove.cpp.
References action, address_needs(), ai_cache, can_move_to(), center, closest_points_first(), current_target(), execute_action(), npc_short_term_cache::friends, move_pause(), move_to(), NPC_DANGER_VERY_LOW, npc_undecided, Creature::pos(), and round().
Referenced by alt_attack(), execute_action(), npc_attack_melee::use(), npc_attack_gun::use(), and npc_attack_throw::use().
|
overridevirtual |
Creature symbol color.
Implements Creature.
Definition at line 2556 of file npc.cpp.
References attitude, c_green, c_light_green, c_light_red, c_pink, c_red, guaranteed_hostile(), is_player_ally(), is_walking_with(), NPCATT_FLEE, NPCATT_FLEE_TEMP, and NPCATT_KILL.
Referenced by overmap_ui::draw_ascii(), dialogue::opt(), and print_info().
| std::pair< skill_id, int > npc::best_combat_skill | ( | combat_skills | subset | ) | const |
Definition at line 1033 of file npc.cpp.
References Character::_skills, ALL, NO_GENERAL, skill_dodge, skill_gun, skill_launcher, skill_melee, skill_stabbing, skill_unarmed, and WEAPONS_ONLY.
Referenced by talk_function::companion_skill_trainer(), faction_display(), and starting_weapon().
| bool npc::bravery_check | ( | int | diff | ) | const |
Definition at line 2512 of file npc.cpp.
References npc_personality::bravery, dice(), and personality.
| bool npc::can_do_pulp | ( | ) |
Returns true if NPC can do pulp in this turn.
Definition at line 3977 of file npcmove.cpp.
References Creature::get_location(), Creature::posz(), pulp_location, and rl_dist().
Referenced by address_needs().
| bool npc::can_move_to | ( | const tripoint & | p, |
| bool | no_bashing = false |
||
| ) | const |
Definition at line 2870 of file npcmove.cpp.
References map::bash_rating(), can_open_door(), g, get_map(), map::has_floor_or_water(), is_hallucination(), map::is_outside(), map::passable(), Creature::pos(), rl_dist(), and smash_ability().
Referenced by avoid_friendly_fire(), good_escape_direction(), and move_away_from().
| bool npc::can_open_door | ( | const tripoint & | p, |
| bool | inside | ||
| ) | const |
Definition at line 2864 of file npcmove.cpp.
References avoid_doors, get_map(), npc_follower_rules::has_flag(), is_hallucination(), map::open_door(), and rules.
Referenced by can_move_to().
| bool npc::can_read | ( | const item & | book, |
| std::vector< std::string > & | fail_reasons | ||
| ) |
Definition at line 1128 of file npc.cpp.
References _, CANT_UNDERSTAND, Character::check_read_condition(), ILLITERATE, MASTERED, NEED_GLASSES, NOT_BOOK, string_format(), item::tname(), and TOO_DARK.
Referenced by do_npc_read().
| bool npc::can_reload_current | ( | ) |
Can reload currently wielded gun?
Definition at line 2146 of file npcmove.cpp.
References find_usable_ammo(), Character::get_wielded_item(), item::is_gun(), wants_to_reload(), and Character::weapon.
Referenced by address_needs(), check_or_use_weapon_cbm(), and evaluate_best_attack().
| bool npc::can_take_that | ( | const item & | it | ) |
Definition at line 3788 of file npcmove.cpp.
References Character::can_stash(), good, LIQUID, item::made_of_from_type(), item::weight(), Character::weight_capacity(), and Character::weight_carried().
Referenced by anonymous_namespace{npcmove.cpp}::good_for_pickup(), and npc_pickup_from_stack().
| bool npc::can_use_offensive_cbm | ( | ) | const |
Definition at line 2293 of file npcmove.cpp.
References npc_follower_rules::cbm_reserve, Character::get_max_power_level(), Character::get_power_level(), and rules.
Referenced by activate_combat_cbms(), execute_action(), and npc_attack_melee::use().
| float npc::character_danger | ( | const Character & | u | ) | const |
| const dialogue_chatbin_snippets & npc::chat_snippets | ( | ) | const |
Definition at line 3805 of file npc.cpp.
References idz, string_id< T >::is_null(), and npc_template::snippets.
Referenced by address_player(), complain(), consume_food_from_camp(), distance_string(), dialogue::dynamic_line(), execute_action(), find_corpse_to_pulp(), find_item(), talker_npc::give_item_to(), handle_sound(), look_for_player(), move_to(), mug_player(), avatar::talk_to(), try_consume(), warn_about(), and wear_if_wanted().
| void npc::check_or_use_weapon_cbm | ( | const bionic_id & | cbm_id | ) |
Definition at line 623 of file bionics.cpp.
References _, add_msg_if_player_sees(), item::ammo_remaining(), can_reload_current(), npc_follower_rules::cbm_reserve, debugmsg, Character::disp_name(), flag_NO_UNWIELD, units::from_kilojoule(), item::get_gun_energy_drain(), item::get_gun_ups_drain(), Character::get_max_power_level(), Character::get_power_level(), bionic::get_uid(), bionic::get_weapon(), Character::get_wielded_item(), npc_follower_rules::has_flag(), item::has_flag(), bionic_data::has_flag(), bionic::has_weapon(), bionic_data::id, bionic::info(), Character::is_armed(), item::is_gun(), item::is_null(), is_player_ally(), item::is_silent(), Character::is_using_bionic_weapon(), json_flag_BIONIC_GUN, json_flag_BIONIC_WEAPON, m_info, Character::mod_power_level(), Character::my_bionics, bionic_data::name, null_item_reference(), Creature::pos(), bionic_data::power_activate, bionic::powered, real_weapon, rules, Character::set_wielded_item(), stow_item(), string_id< T >::str(), use_guns, use_silent, Character::weapon, Character::weapon_bionic_uid, and Character::weapon_value().
Referenced by activate_combat_cbms().
| void npc::cleanup_on_no_danger | ( | ) |
Definition at line 2375 of file npcmove.cpp.
References deactivate_combat_cbms(), and deactivate_combat_items().
Referenced by move().
| void npc::clear_personality_traits | ( | ) |
Definition at line 697 of file npc.cpp.
References Character::get_mutations(), and Character::unset_mutation().
| std::optional< int > npc::closest_enemy_to_friendly_distance | ( | ) | const |
Definition at line 2949 of file npc.cpp.
References ai_cache, and npc_short_term_cache::closest_enemy_to_friendly_distance().
Referenced by npc_attack_melee::use().
| bool npc::complain | ( | ) |
Definition at line 5242 of file npcmove.cpp.
References activate_bionic_by_id(), bio_radscrubber, body_part_name(), bp, bp_affected(), chat_snippets(), complain_about(), deactivate_bionic_by_id(), effect_bite, effect_bleed, effect_hypovolemia, effect_infected, time_duration::from_hours(), time_duration::from_minutes(), Creature::get_effect(), Character::get_hunger(), effect::get_intensity(), get_player_character(), get_player_view(), Character::get_rad(), Character::get_sleepiness(), get_thirst(), Creature::has_effect(), intensity, is_player_ally(), MASSIVE_SLEEPINESS, max(), NPC_HUNGER_COMPLAIN, NPC_THIRST_COMPLAIN, parse_tags(), Character::sees(), dialogue_chatbin_snippets::snip_bleeding, dialogue_chatbin_snippets::snip_bleeding_badly, dialogue_chatbin_snippets::snip_lost_blood, dialogue_chatbin_snippets::snip_radiation_sickness, dialogue_chatbin_snippets::snip_wound_bite, dialogue_chatbin_snippets::snip_wound_infected, speech, string_format(), TIRED, and translation::translated().
Referenced by execute_action().
| bool npc::complain_about | ( | const std::string & | issue, |
| const time_duration & | dur, | ||
| const std::string & | speech, | ||
| bool | force = false, |
||
| sounds::sound_t | priority = sounds::sound_t::speech |
||
| ) |
Definition at line 5211 of file npcmove.cpp.
References allow_complain, complaints, dur, force, get_player_character(), npc_follower_rules::has_flag(), Character::in_sleep_state(), rules, say(), speech, and calendar::turn.
Referenced by complain(), consume_food_from_camp(), execute_action(), look_for_player(), Character::process_effects(), and warn_about().
| double npc::confidence_mult | ( | ) | const |
Definition at line 2654 of file npcmove.cpp.
References npc_follower_rules::aim, emergency(), is_player_ally(), PRECISE, rules, SPRAY, STRICTLY_PRECISE, and WHEN_CONVENIENT.
Referenced by confident_gun_mode_range(), and confident_throw_range().
| int npc::confident_gun_mode_range | ( | const gun_mode & | gun, |
| int | at_recoil | ||
| ) | const |
Definition at line 2687 of file npcmove.cpp.
References add_msg_debug, confidence_mult(), debugmode::DF_NPC, Character::get_weapon_dispersion(), gun, dispersion_sources::max(), and range_with_even_chance_of_good_hit().
Referenced by confident_shoot_range(), and npc_attack_gun::use().
| int npc::confident_shoot_range | ( | const item & | it, |
| int | at_recoil | ||
| ) | const |
Definition at line 2674 of file npcmove.cpp.
References confident_gun_mode_range(), item::gun_all_modes(), item::is_gun(), max(), and Character::recoil.
Referenced by invalidate_range_cache(), and wont_hit_friend().
Definition at line 2703 of file npcmove.cpp.
References add_msg_debug, confidence_mult(), debugmode::DF_NPC, Creature::ranged_target_size(), and Character::throwing_dispersion().
Referenced by alt_attack(), and wont_hit_friend().
| bool npc::consume_food | ( | ) |
Returns true if food was consumed, false otherwise.
Definition at line 4615 of file npcmove.cpp.
References Character::cache_get_items_with(), Character::consume(), debugmsg, Character::get_consume_time(), Character::get_hunger(), Character::get_name(), get_thirst(), item::is_food(), is_player_ally(), max(), Creature::mod_moves(), NONE, rate_food(), Character::set_hunger(), Character::set_thirst(), item::tname(), and Character::will_eat().
Referenced by address_needs().
| bool npc::consume_food_from_camp | ( | ) |
Definition at line 4543 of file npcmove.cpp.
References base_metabolic_rate, basecamp::camp_food_supply(), Character::camps, stomach_contents::capacity(), chat_snippets(), complain_about(), stomach_contents::contains(), overmapbuffer::find_camp(), faction_template::food_supply, stomach_contents::get_calories(), Character::get_faction(), Character::get_healthy_kcal(), Character::get_hunger(), get_player_character(), Character::get_stored_kcal(), get_thirst(), Creature::global_omt_location(), Character::guts, basecamp::has_water(), stomach_contents::ingest(), is_player_ally(), nutrients::kcal(), max(), min(), overmap_buffer, rl_dist(), Character::set_hunger(), Character::set_thirst(), Character::stomach, and coords::coord_point< Point, Origin, Scale, InBounds >::xy().
Referenced by address_needs().
|
private |
Definition at line 400 of file npcmove.cpp.
References map::field_at(), field::find_field(), get_map(), Creature::is_dangerous_field(), Character::move_in_vehicle(), map::passable(), Creature::pos(), and sees_dangerous_field().
Referenced by could_move_onto(), execute_action(), move_to(), and worker_downtime().
|
private |
Definition at line 429 of file npcmove.cpp.
References could_move_onto(), and coords::coord_point_mut< Point, Subpoint, InBounds >::raw().
| Creature * npc::current_ally | ( | ) |
Definition at line 5118 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::ally.
| const Creature * npc::current_ally | ( | ) | const |
Definition at line 5110 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::ally.
Referenced by execute_action().
| Creature * npc::current_target | ( | ) |
Definition at line 5104 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::target.
| const Creature * npc::current_target | ( | ) | const |
Definition at line 5096 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::target.
Referenced by alt_attack(), avoid_friendly_fire(), enough_time_to_reload(), execute_action(), faction_display(), get_current_status(), method_of_attack(), and move().
| float npc::danger_assessment | ( | ) | const |
Definition at line 2501 of file npc.cpp.
References ai_cache, and npc_short_term_cache::danger_assessment.
Referenced by say().
| bool npc::deactivate_bionic_by_id | ( | const bionic_id & | cbm_id, |
| bool | eff_only = false |
||
| ) |
Definition at line 2262 of file npcmove.cpp.
References Character::deactivate_bionic(), and Character::my_bionics.
Referenced by address_needs(), complain(), deactivate_combat_cbms(), and move_pause().
| void npc::deactivate_combat_cbms | ( | ) |
Definition at line 2221 of file npcmove.cpp.
References bio_hydraulics, deactivate_bionic_by_id(), deactivate_or_discharge_bionic_weapon(), anonymous_namespace{npcmove.cpp}::defense_cbms, Character::weapon_bionic_uid, and anonymous_namespace{npcmove.cpp}::weapon_cbms.
Referenced by cleanup_on_no_danger().
| void npc::deactivate_combat_items | ( | ) |
Definition at line 2364 of file npcmove.cpp.
References outfit::deactivate_combat_items(), and Character::worn.
Referenced by cleanup_on_no_danger().
| void npc::deactivate_or_discharge_bionic_weapon | ( | bool | stow_real_weapon = false | ) |
Definition at line 600 of file bionics.cpp.
References Character::deactivate_bionic(), debugmsg, discharge_cbm_weapon(), Character::find_bionic_by_uid(), Character::get_weapon_bionic_uid(), bionic_data::has_flag(), bionic::info(), Character::is_using_bionic_weapon(), json_flag_BIONIC_GUN, bionic::powered, and Character::weapon_bionic_uid.
Referenced by deactivate_combat_cbms(), and stow_item().
| void npc::decide_needs | ( | ) |
Definition at line 1670 of file npc.cpp.
References item::ammo_type(), base_location, Character::cache_visit_items_with(), item::energy_remaining(), Character::get_ammo(), item::get_comestible(), item::get_gun_energy_drain(), Character::get_hunger(), get_thirst(), Character::get_wielded_item(), item::is_food(), item::is_gun(), need_ammo, need_drink, need_food, need_none, need_safety, need_weapon, needs, string_id< ammunition_type >::NULL_ID(), null_item_reference(), num_needs, Character::nutrition_for(), Character::weapon, and Character::weapon_value().
Referenced by form_opinion(), talker_npc::get_topics(), and set_omt_destination().
| std::string npc::describe_mission | ( | ) | const |
Definition at line 3745 of file npc.cpp.
References _, debugmsg, npc_class::get_job_description(), myclass, NPC_MISSION_ACTIVITY, NPC_MISSION_GUARD, NPC_MISSION_GUARD_ALLY, NPC_MISSION_GUARD_PATROL, NPC_MISSION_NULL, NPC_MISSION_SHELTER, NPC_MISSION_SHOPKEEP, NPC_MISSION_TRAVELLING, string_id< T >::obj(), and string_format().
Referenced by talker_npc::get_job_description().
|
overridevirtual |
Implements Character.
Definition at line 2037 of file savegame_json.cpp.
References item_pocket::data, and ammo_effects::load().
Referenced by import_and_clean().
|
overridevirtual |
Empty function.
Should always be overwritten by the appropriate player/NPC/monster version.
Reimplemented from Character.
Definition at line 2790 of file npc.cpp.
References _, Character::add_morale(), add_msg(), add_msg_if_player_sees(), assigned_camp, character_dies, character_id, character_kills_character, dead, Character::death_eocs, debugmsg, Character::die(), effect_ridden, eoc, overmapbuffer::find_camp(), get_event_bus(), get_map(), Character::get_name(), get_player_character(), get_talker_for(), Character::getID(), Character::has_flag(), Character::has_trait(), hit_by_player, Character::in_vehicle, Character::inv_dump(), is_dead(), Creature::is_fake(), is_hallucination(), Character::is_mounted(), json_flag_CANNIBAL, json_flag_PSYCHOPATH, json_flag_SAPIOVORE, json_flag_SPIRITUAL, Creature::killer, Creature::lifespan_end, faction::members, min(), MORALE_KILLED_INNOCENT, MORALE_KILLER_HAS_KILLED, Character::mounted_creature, monster::mounted_player, monster::mounted_player_id, Character::my_fac, NPC_DEATH, overmap_buffer, Character::place_corpse(), Creature::pos(), prevent_death_reminder, Creature::remove_effect(), faction::remove_member(), event_bus::send(), trait_KILLER, trait_PACIFIST, and map::unboard_vehicle().
Referenced by address_needs(), talker_npc::die(), and on_attacked().
| void npc::discharge_cbm_weapon | ( | bool | fired = true, |
| bool | stow_real_weapon = false |
||
| ) |
Definition at line 575 of file bionics.cpp.
References debugmsg, item::get_gun_bionic_drain(), item_location::get_item(), Character::get_wielded_item(), Character::is_using_bionic_weapon(), item, Character::mod_power_level(), real_weapon, Character::set_wielded_item(), stow_item(), and Character::weapon_bionic_uid.
Referenced by deactivate_or_discharge_bionic_weapon(), and execute_action().
|
overridevirtual |
Drop, wear, stash or otherwise try to dispose of an item consuming appropriate moves.
| obj | item to dispose of |
| prompt | optional message to display in any menu |
Reimplemented from Character.
Definition at line 3175 of file npc.cpp.
References stow_item().
| std::string npc::distance_string | ( | int | range | ) | const |
Definition at line 5140 of file npcmove.cpp.
References chat_snippets(), dialogue_chatbin_snippets::snip_close_distance, dialogue_chatbin_snippets::snip_danger_close_distance, dialogue_chatbin_snippets::snip_far_distance, dialogue_chatbin_snippets::snip_medium_distance, and translation::translated().
Referenced by warn_about().
| void npc::do_npc_craft | ( | const std::optional< tripoint > & | loc = std::nullopt, |
| const recipe_id & | goto_recipe = recipe_id() |
||
| ) |
Definition at line 3132 of file crafting.cpp.
References item::get_making(), item::is_craft(), NEXT, recipe::npc_can_craft(), and Character::visit_items().
Referenced by talk_function::do_craft().
| void npc::do_npc_read | ( | bool | ebook = false | ) |
Definition at line 1182 of file npc.cpp.
References _, add_msg(), add_msg_if_player_sees(), Character::as_character(), Character::assign_activity(), can_read(), Character::disp_name(), game_menus::inv::ebookread(), game_menus::inv::ereader_to_use(), Creature::get_value(), Character::getID(), item_location::obtain(), Creature::pos(), game_menus::inv::read(), say(), and time_to_read().
Referenced by talk_function::do_eread(), and talk_function::do_read().
| bool npc::do_player_activity | ( | ) |
perform a player activity, returning true if it took up the turn
Definition at line 3989 of file npcmove.cpp.
References _, ACT_CRAFT, ACT_TIDY_UP, Character::activity, add_msg(), Character::as_character(), Character::backlog, current_activity_id, Character::disp_name(), player_activity::do_turn(), generic_multi_activity_handler(), Character::has_destination(), player_activity::id(), is_active(), player_activity::is_multi_type(), is_player_ally(), m_info, Creature::mod_moves(), Creature::moves, string_id< activity_type >::NULL_ID(), revert_after_activity(), Creature::set_moves(), and string_format().
Referenced by execute_action().
| void npc::do_reload | ( | const item_location & | it | ) |
Definition at line 5350 of file npcmove.cpp.
References _, add_msg(), item::reload_option::ammo, itype::ammo, item::ammo_capacity(), item::ammo_data(), item::ammo_remaining(), item::charges, debugmsg, sfx::get_heard_angle(), sfx::get_heard_volume(), Character::get_name(), get_player_view(), has_new_items, Character::item_reload_cost(), max(), MAX_RECOIL, min(), Creature::mod_moves(), Character::name, sfx::play_variant_sound(), Creature::pos(), Character::recoil, item::reload(), Character::sees(), select_ammo(), string_id< T >::str(), item::reload_option::target, item::tname(), and item::typeId().
Referenced by address_needs(), execute_action(), and npc_attack_gun::use().
|
overridevirtual |
Reimplemented from Character.
Definition at line 1374 of file npc.cpp.
References Character::activity, player_activity::do_turn(), and Character::drop().
| bool npc::emergency | ( | ) | const |
Definition at line 2517 of file npc.cpp.
References ai_cache, and npc_short_term_cache::danger_assessment.
Referenced by npc_attack_activate_item::all_evaluations(), confidence_mult(), and npc_attack_activate_item::evaluate().
| bool npc::emergency | ( | float | danger | ) | const |
Definition at line 2522 of file npc.cpp.
References npc_personality::bravery, Character::hp_percentage(), and personality.
| bool npc::enough_time_to_reload | ( | const item & | gun | ) | const |
Definition at line 2762 of file npcmove.cpp.
References add_msg_debug, current_target(), debugmode::DF_NPC_ITEMAI, Character::get_speed(), Character::get_wielded_item(), gun, item::gun_range(), Creature::is_avatar(), item::is_gun(), Creature::is_npc(), item, item_controller, Character::item_reload_cost(), Character::name, Creature::pos(), rl_dist(), Character::sees(), Creature::speed_rating(), and Character::weapon.
| void npc::escape_explosion | ( | ) |
Definition at line 3211 of file npcmove.cpp.
References ai_cache, npc_short_term_cache::dangerous_explosives, move_away_from(), and warn_about().
Referenced by execute_action().
| float npc::estimate_armour | ( | const Character & | candidate | ) | const |
Definition at line 649 of file npcmove.cpp.
References add_msg_debug, body_part_name(), damage_bash, damage_bullet, damage_cut, damage_stab, debugmode::DF_NPC_ITEMAI, Character::disp_name(), Creature::get_all_body_parts(), Character::get_armor_type(), Character::name, and only_main.
Referenced by evaluate_character(), and evaluate_self().
| void npc::evaluate_best_attack | ( | const Creature * | target | ) |
Definition at line 1985 of file npcmove.cpp.
References ai_cache, can_reload_current(), Character::can_use(), game_menus::inv::compare(), npc_short_term_cache::current_attack, npc_short_term_cache::current_attack_evaluation, flag_NO_UNWIELD, get_event_bus(), Character::getID(), item::gun_all_modes(), npc_follower_rules::has_flag(), item::has_flag(), is_player_ally(), Character::is_wielding(), Character::magic, NEXT, null_item_reference(), opens_spellbook, rules, event_bus::send(), item::shots_remaining(), item::type, use_guns, itype::use_methods, use_silent, and Character::visit_items().
Referenced by method_of_attack().
| item * npc::evaluate_best_weapon | ( | ) | const |
Definition at line 4064 of file npcmove.cpp.
References ai_cache, npc_short_term_cache::danger_assessment, item::empty(), evaluate_weapon(), itype::get_id(), item::get_use(), Character::get_wielded_item(), npc_follower_rules::has_flag(), item::is_gun(), item::is_melee(), is_player_ally(), Character::is_using_bionic_weapon(), NEXT, null_item_reference(), rules, SKIP, item::type, use_guns, use_silent, Character::visit_items(), Character::weapon, and Character::weapon_value().
Referenced by npc_attack_throw::evaluate(), and wield_better_weapon().
| float npc::evaluate_character | ( | const Character & | candidate, |
| bool | my_gun, | ||
| bool | enemy = true |
||
| ) |
Definition at line 484 of file npcmove.cpp.
References add_msg_debug, npc_personality::aggression, bp, npc_personality::bravery, debugmode::DF_NPC, debugmode::DF_NPC_COMBATAI, Character::disp_name(), effect_bleed, effect_npc_run_away, npc_combat_memory_cache::engagement_distance, estimate_armour(), npc_combat_memory_cache::formation_distance, Creature::get_all_body_parts(), Character::get_dodge(), Creature::get_effect(), effect::get_intensity(), Character::get_per(), Character::get_speed(), Character::get_wielded_item(), Creature::has_effect(), Character::hp_percentage(), Creature::is_avatar(), item::is_gun(), effect::is_null(), is_player_ally(), max(), mem_combat, min(), Character::name, NPC_CHARACTER_DANGER_MAX, null_item_reference(), personality, Creature::pos(), rl_dist(), rng(), speed, and Character::weapon_value().
Referenced by assess_danger().
| float npc::evaluate_monster | ( | const monster & | target, |
| int | dist | ||
| ) | const |
rates how dangerous a target is
Definition at line 467 of file npcmove.cpp.
References add_msg_debug, debugmode::DF_NPC_COMBATAI, mtype::difficulty, monster::get_hp(), monster::get_hp_max(), max(), min(), Character::name, mtype::nname(), NPC_DANGER_VERY_LOW, NPC_MONSTER_DANGER_MAX, speed, monster::speed_rating(), and monster::type.
Referenced by assess_danger().
| float npc::evaluate_self | ( | bool | my_gun | ) |
Definition at line 588 of file npcmove.cpp.
References add_msg_debug, npc_personality::aggression, ai_cache, bp, npc_personality::bravery, debugmode::DF_NPC, debugmode::DF_NPC_COMBATAI, effect_bleed, estimate_armour(), Creature::get_all_body_parts(), Character::get_dodge(), Creature::get_effect(), effect::get_intensity(), Creature::get_pain(), Character::get_per(), Character::get_speed(), Creature::has_effect(), Character::hp_percentage(), effect::is_null(), max(), mem_combat, min(), npc_combat_memory_cache::my_health, npc_short_term_cache::my_weapon_value, Character::name, NPC_CHARACTER_DANGER_MAX, npc_combat_memory_cache::panic, personality, rng(), and speed.
Referenced by assess_danger().
| int npc::evaluate_sleep_spot | ( | tripoint_bub_ms | p | ) |
Definition at line 2043 of file npcmove.cpp.
References Character::floor_bedding_warmth(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), Character::sleep_spot(), and Character::very_comfortable.
Referenced by execute_action().
| double npc::evaluate_weapon | ( | item & | maybe_weapon, |
| bool | can_use_gun, | ||
| bool | use_silent | ||
| ) | const |
Definition at line 4045 of file npcmove.cpp.
References add_msg_debug, debugmode::DF_NPC_ITEMAI, Character::disp_name(), itype::get_id(), Character::gun_value(), item::is_gun(), item::is_silent(), max(), Character::melee_value(), item::shots_remaining(), string_id< T >::str(), item::type, and use_silent.
Referenced by evaluate_best_weapon(), and wield_better_weapon().
| void npc::execute_action | ( | npc_action | action | ) |
Definition at line 1565 of file npcmove.cpp.
References _, action, activate_bionic_by_id(), ACTIVITY_SEARCH_DISTANCE, Creature::add_effect(), add_msg_debug, add_msg_if_player_sees(), ai_cache, aim(), avoid_friendly_fire(), bio_hydraulics, bio_soporific, can_use_offensive_cbm(), chat_snippets(), closest_points_first(), complain(), complain_about(), could_move_onto(), vehicle_part::crew(), current_ally(), npc_short_term_cache::current_attack, npc_short_term_cache::current_attack_evaluation, current_target(), debugmsg, debugmode::DF_NPC, discharge_cbm_weapon(), Character::disp_name(), do_player_activity(), do_reload(), Character::drop_invalid_inventory(), effect_lying_down, escape_explosion(), evaluate_sleep_spot(), Character::fire_gun(), follow_distance(), g, vehicle::get_avail_parts(), get_avatar(), Creature::get_location(), get_map(), Character::get_name(), vehicle::get_passenger(), get_player_character(), get_talker_for(), Character::get_wielded_item(), Character::getID(), map::getlocal(), vehicle::global_part_pos3(), go_to_omt_destination(), good_escape_direction(), goto_to_this_pos, npc_short_term_cache::guard_pos, item::gun_current_mode(), Creature::has_effect(), heal_player(), heal_self(), Character::in_sleep_state(), is_hallucination(), Character::is_using_bionic_weapon(), is_walking_with(), last_player_seen_pos, look_for_player(), Character::melee_attack(), move_pause(), move_to(), move_to_next(), Creature::moves, mug_player(), npc_action_name(), npc_aim, npc_avoid_friendly_fire, npc_do_attack, npc_drop_items, npc_escape_explosion, npc_flee, npc_follow_embarked, npc_follow_player, npc_goto_destination, npc_goto_to_this_pos, npc_heal, npc_heal_player, npc_investigate_sound, npc_look_for_player, npc_melee, npc_mug_player, npc_noop, npc_pause, npc_pickup, npc_player_activity, npc_reach_attack, npc_reload, npc_return_to_guard_pos, npc_shoot, npc_sleep, npc_talk_to_player, npc_undecided, npc_use_painkiller, npc_worker_downtime, parse_tags(), path, pick_up_item(), Creature::pos(), Creature::pos_bub(), Creature::posz(), pretend_fire(), gun_mode::qty, Character::reach_attack(), npc_short_term_cache::s_abs_pos, saw_player_recently(), say(), Character::sees(), Creature::set_moves(), dialogue_chatbin_snippets::snip_heal_player, string_format(), npc_short_term_cache::stuck, avatar::talk_to(), npc_attack_rating::target(), translation::translated(), update_path(), use_painkiller(), map::veh_at(), veh_pointer_or_null(), Character::very_comfortable, VPFLAG_BOARDABLE, and worker_downtime().
Referenced by avoid_friendly_fire(), and move().
| void npc::export_to | ( | const cata_path & | path | ) | const |
Definition at line 1802 of file savegame.cpp.
References path, savegame_version, serialize(), and write_to_file().
Referenced by debug_menu::debug(), and avatar::export_as_npc().
|
overridevirtual |
Reimplemented from Character.
Definition at line 3372 of file npc.cpp.
References _, attitude, Character::extended_description(), guaranteed_hostile(), hit_by_player, is_following(), is_leader(), is_player_ally(), NPCATT_FLEE, NPCATT_FLEE_TEMP, NPCATT_KILL, and replace_colors().
| int npc::faction_display | ( | const catacurses::window & | fac_w, |
| int | width | ||
| ) | const |
Definition at line 615 of file faction.cpp.
References _, a, action_of(), assigned_camp, b, best_combat_skill(), c_light_gray, c_light_green, c_light_red, c_white, Character::cache_has_item_with_flag(), basecamp::camp_name(), companion_mission_time_ret, current_target(), direction_from(), direction_name(), overmapbuffer::find_camp(), fold_and_print(), overmapbuffer::get_camps_near(), get_companion_mission(), get_current_status(), get_mission_destination(), get_player_character(), Character::get_skill_level(), Skill::get_skills_sorted_by(), catacurses::getmaxx(), Creature::global_omt_location(), Creature::global_sm_location(), has_companion_mission(), has_job(), hp_description(), display::hunger_text_color(), mission_id::id, json_flag_TWO_WAY_RADIO, localized_compare, npc_companion_mission::miss_id, mvwprintz(), Character::name, NO_GENERAL, overmap_buffer, pgettext, point, Creature::pos(), rl_dist(), second, Character::sees(), SEEX, display::sleepiness_text_color(), square_dist(), string_format(), display::thirst_text_color(), coords::coord_point_base< Point >::to_string(), to_string(), calendar::turn, utf8_width(), Character::weapname_simple(), and tripoint::z.
Referenced by faction_manager::display().
| bool npc::find_corpse_to_pulp | ( | ) |
Returns true if it finds one.
Definition at line 3889 of file npcmove.cpp.
References allow_pulp, chat_snippets(), corpse, npc_combat_memory_cache::engagement_distance, map::get_active_items_in_radius(), Creature::get_location(), get_map(), get_player_character(), map::getglobal(), map::getlocal(), npc_follower_rules::has_flag(), map::i_at(), Character::in_vehicle, Creature::is_dangerous_field(), is_hallucination(), is_player_ally(), is_walking_with(), Creature::location, mem_combat, parse_tags(), Creature::pos(), pulp_location, rl_dist(), rules, say(), Character::sees(), map::sees_some_items(), dialogue_chatbin_snippets::snip_pulp_zombie, square_dist(), string_format(), translation::translated(), and update_path().
Referenced by address_needs().
|
private |
Definition at line 434 of file npcmove.cpp.
References explosion_iuse::explosion, explosive, map::get_active_items_in_radius(), get_map(), MAX_VIEW_DISTANCE, Creature::pos(), rl_dist(), explosion_data::safe_range(), speed_rating(), and Character::use().
Referenced by regen_ai_cache().
| void npc::find_item | ( | ) |
Definition at line 3492 of file npcmove.cpp.
References _, add_msg_debug, ai_cache, allow_pick_up, optional_vpart_position::cargo(), chat_snippets(), closest_points_first(), debugmode::DF_NPC_ITEMAI, item::empty(), fetching_item, g, lru_cache< Key, Value >::get(), map::get_harvest_names(), item_location::get_item(), Creature::get_location(), get_map(), anonymous_namespace{npcmove.cpp}::good_for_pickup(), harvest, npc_follower_rules::has_flag(), has_item_whitelist(), map::i_at(), lru_cache< Key, Value >::insert(), is_hallucination(), is_player_ally(), is_walking_with(), item_name_whitelisted(), itype_lsd, itype_thorazine, minimum_item_value(), Character::name, nearest_passable(), optional_vpart_position::part_with_feature(), path, Creature::pos(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), rl_dist(), rules, say(), npc_short_term_cache::searched_tiles, see_item_say_smth(), Character::sees(), map::sees_some_items(), item_stack::size(), item::tname(), update_path(), value(), map::veh_at(), Character::volume_capacity(), Character::volume_carried(), wanted_item, wanted_item_pos, Character::weight_capacity(), Character::weight_carried(), and zone_type_NO_NPC_PICKUP.
Referenced by move().
| bool npc::find_job_to_perform | ( | ) |
Definition at line 3262 of file npcmove.cpp.
References ACT_MOVE_LOOT, Character::as_character(), Character::assign_activity(), job_data::fetch_history, generic_multi_activity_handler(), job_data::get_prioritised_vector(), job_data::get_priority_of_job(), job, and calendar::turn.
Referenced by move().
| item_location npc::find_reloadable | ( | ) |
Has a gun or magazine that can be reloaded.
Definition at line 2108 of file npcmove.cpp.
References ABORT, add_msg_debug, item::reload_option::ammo, Character::cached_info, debugmode::DF_NPC_ITEMAI, form_loc_recursive(), Character::name, NEXT, select_ammo(), item::tname(), Character::visit_items(), wants_to_reload(), and wants_to_reload_with().
Referenced by address_needs().
| item_location npc::find_usable_ammo | ( | const item_location & | weap | ) |
Finds ammo the NPC could use to reload a given object.
Definition at line 2156 of file npcmove.cpp.
References item::reload_option::ammo, Character::can_reload(), select_ammo(), and wants_to_reload_with().
Referenced by can_reload_current(), and find_usable_ammo().
| item_location npc::find_usable_ammo | ( | const item_location & | weap | ) | const |
Definition at line 2170 of file npcmove.cpp.
References find_usable_ammo().
| int npc::follow_distance | ( | ) | const |
Definition at line 2534 of file npc.cpp.
References follow_distance_2, get_map(), get_player_character(), npc_follower_rules::has_flag(), map::has_flag(), is_walking_with(), Creature::pos(), rules, Character::sees(), TFLAG_GOES_DOWN, and TFLAG_GOES_UP.
Referenced by assess_danger(), execute_action(), good_escape_direction(), and move().
| void npc::form_opinion | ( | const Character & | you | ) |
Definition at line 1397 of file npc.cpp.
References add_msg_debug, npc_personality::aggression, attitude, npc_personality::bravery, decide_needs(), debugmode::DF_NPC, npc_opinion::fear, Character::get_name(), get_opinion_values(), is_player_ally(), faction_template::likes_u, mutiny(), Character::my_fac, need_drink, need_food, needs, npc_attitude_id(), NPCATT_FLEE_TEMP, NPCATT_KILL, NPCATT_TALK, op_of_u, personality, set_attitude(), npc_opinion::trust, and npc_opinion::value.
| void npc::generate_personality_traits | ( | ) |
Definition at line 706 of file npc.cpp.
References npc_personality::aggression, npc_personality::altruism, npc_personality::bravery, npc_personality::collector, mutation_branch::get_all(), personality, and Character::set_mutation().
Referenced by randomize().
|
overridevirtual |
Reimplemented from Character.
Definition at line 3546 of file npc.cpp.
References attitude.
Referenced by debug_menu::character_edit_menu(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_wants_to_talk(), talker_npc::get_topics(), handle_sound(), talk_function::hostile(), is_ally(), mission::is_complete(), game::list_monsters(), game::mon_info_update(), talk_function::npc_thankful(), print_info(), and talker_npc::will_talk_to_u().
| attitude_group npc::get_attitude_group | ( | npc_attitude | att | ) | const |
Definition at line 3495 of file npc.cpp.
References fearful, friendly, hostile, neutral, NPCATT_ACTIVITY, NPCATT_FLEE, NPCATT_FLEE_TEMP, NPCATT_FOLLOW, NPCATT_KILL, NPCATT_LEAD, NPCATT_MUG, and NPCATT_WAIT_FOR_LEAVE.
Referenced by handle_sound(), is_ally(), and set_attitude().
| const std::vector< weak_ptr_fast< Creature > > & npc::get_cached_friends | ( | ) | const |
Definition at line 2954 of file npc.cpp.
References ai_cache, and npc_short_term_cache::friends.
Referenced by indoor_voice().
| npc_companion_mission npc::get_companion_mission | ( | ) | const |
Definition at line 3490 of file npc.cpp.
References comp_mission.
Referenced by companion_per_recipe_building_type(), faction_display(), and update_emergency_recall().
| std::string npc::get_current_activity | ( | ) | const |
Returns the current activity name (reading, disassembling, etc.), or "nothing".
Definition at line 3786 of file npc.cpp.
References _, current_activity_id, string_id< T >::obj(), translation::translated(), and activity_type::verb().
Referenced by get_current_status(), name_and_activity(), and parse_tags().
|
inline |
Definition at line 1352 of file npc.h.
References ai_cache, and npc_short_term_cache::current_attack.
|
inline |
Definition at line 1356 of file npc.h.
References ai_cache, and npc_short_term_cache::current_attack_evaluation.
| std::string npc::get_current_status | ( | ) | const |
Returns current status (Sleeping, Guarding, In Combat, etc.), or current activity.
Definition at line 596 of file faction.cpp.
References _, current_target(), get_current_activity(), Character::in_sleep_state(), is_following(), is_guarding(), is_leader(), and is_patrolling().
Referenced by faction_display().
| std::string npc::get_epilogue | ( | ) | const |
Definition at line 3404 of file npc.cpp.
References Character::male, snippet_library::random_from_category(), and SNIPPET.
| faction_id npc::get_fac_id | ( | ) | const |
Definition at line 771 of file npc.cpp.
References Character::fac_id.
Referenced by add_fallback_zone(), consume_items_in_zones(), distribute_items_to_npc_zones(), get_basecamp(), read_activity_actor::npc_read(), and trade_ui::trade_ui().
|
overridevirtual |
Reimplemented from Character.
Definition at line 776 of file npc.cpp.
References faction_no_faction, g, and Character::my_fac.
Referenced by talker_npc::add_faction_rep(), shopkeeper_item_group::can_sell(), debug_menu::character_edit_menu(), get_price_rules(), is_ally(), talk_function::mission_success(), starting_weapon(), talker_npc::will_talk_to_u(), and would_take_that().
| int npc::get_faction_ver | ( | ) | const |
Definition at line 2239 of file npc.cpp.
References Character::faction_api_version.
Referenced by debug_menu::character_edit_menu(), and update_faction_api().
| item & npc::get_healing_item | ( | healing_options | try_to_fix, |
| bool | first_best = false |
||
| ) |
Definition at line 2200 of file npc.cpp.
References ABORT, healing_options::bandage, heal_actor::bandages_power, heal_actor::bite, healing_options::bite, heal_actor::bleed, healing_options::bleed, healing_options::disinfect, heal_actor::disinfectant_power, itype::get_use(), heal_actor::infect, healing_options::infect, NEXT, null_item_reference(), item::type, Character::use(), and Character::visit_items().
Referenced by has_healing_item(), heal_player(), and heal_self().
| item_location npc::get_item_to_craft | ( | ) |
Definition at line 3087 of file crafting.cpp.
References item::get_var(), Character::name, NEXT, and Character::visit_items().
Referenced by can_do_activity_there(), and generic_multi_activity_do().
| bool npc::get_known_to_u | ( | ) | const |
Definition at line 947 of file npc.cpp.
References known_to_u.
|
static |
Definition at line 3253 of file npc.cpp.
References need_data, and second.
Referenced by set_omt_destination().
| std::optional< tripoint_abs_omt > npc::get_mission_destination | ( | ) | const |
Definition at line 3476 of file npc.cpp.
References comp_mission, and npc_companion_mission::destination.
Referenced by faction_display().
|
overridevirtual |
For mutant NPCs.
Returns how monsters perceive said NPC. Doesn't imply NPC sees them the same.
Implements Creature.
Definition at line 3352 of file npc.cpp.
References Character::has_trait(), string_id< T >::id(), is_player_ally(), string_id< T >::is_valid(), faction_template::mon_faction, monfaction_bee, monfaction_human, monfaction_player, Character::my_fac, and trait_BEE.
|
static |
Definition at line 3248 of file npc.cpp.
References need_data.
Referenced by debug_menu::character_edit_menu(), operator<<(), and set_omt_destination().
| npc_opinion npc::get_opinion_values | ( | const Character & | you | ) | const |
Definition at line 1426 of file npc.cpp.
References bp, effect_drunk, effect_high, Character::enchantment_cache, npc_opinion::fear, flag_PRIMITIVE_RANGED_WEAPON, Creature::get_all_body_parts(), Creature::get_body(), outfit::get_coverage(), Character::get_mutations(), Character::get_painkiller(), get_player_character(), Character::get_stim(), Character::get_wielded_item(), Creature::has_effect(), item::has_flag(), Character::has_flag(), Character::has_trait(), Character::is_armed(), item::is_gun(), json_flag_SAPIOVORE, op_of_u, Character::str_max, trait_TERRIFYING, npc_opinion::trust, body_part_type::ugliness, enchant_vals::UGLINESS, body_part_type::ugliness_mandatory, npc_opinion::value, Character::weapon, Character::weapon_value(), and Character::worn.
Referenced by form_opinion().
|
overridevirtual |
Returns a set of points we do not want to path through.
Reimplemented from Character.
Definition at line 3312 of file npc.cpp.
References avoid_doors, avoid_locks, doors::can_unlock_door(), map::close_door(), g, get_map(), get_player_character(), npc_follower_rules::has_flag(), hold_the_line, map::move_cost(), Character::move_in_vehicle(), map::open_door(), optional_vpart_position::part_with_feature(), map::points_in_radius(), Creature::pos(), cata::hash64_detail::ret, rules, sees_dangerous_field(), map::veh_at(), and VPFLAG_CARGO.
Referenced by add_fallback_zone(), go_to_omt_destination(), and update_path().
|
overridevirtual |
Returns settings for pathfinding.
Reimplemented from Character.
Definition at line 3287 of file npc.cpp.
Referenced by add_fallback_zone(), go_to_omt_destination(), and update_path().
| const pathfinding_settings & npc::get_pathfinding_settings | ( | bool | no_bashing | ) | const |
Definition at line 3292 of file npc.cpp.
References Character::get_dex(), Character::has_trait(), min(), Character::path_settings, smash_ability(), and trait_NO_BASH.
| npc_attitude npc::get_previous_attitude | ( | ) |
| npc_mission npc::get_previous_mission | ( | ) | const |
| faction_price_rule const * npc::get_price_rules | ( | item const & | it | ) | const |
Definition at line 2109 of file npc.cpp.
References get_faction(), faction::get_price_rules(), npc_class::get_price_rules(), myclass, and cata::hash64_detail::ret.
Referenced by npc_trading::adjusted_price().
| std::string npc::get_restock_interval | ( | ) | const |
Definition at line 2019 of file npc.cpp.
References restock, to_string(), and calendar::turn.
Referenced by parse_tags().
| std::string const & npc::get_specified_talk_topic | ( | std::string const & | topic_id | ) |
Definition at line 7189 of file npctalk.cpp.
References chatbin, dialogue_chatbin::first_topic, dialogue_chatbin::talk_friend, dialogue_chatbin::talk_friend_guard, dialogue_chatbin::talk_leader, dialogue_chatbin::talk_mug, dialogue_chatbin::talk_radio, dialogue_chatbin::talk_stole_item, dialogue_chatbin::talk_stranger_aggressive, dialogue_chatbin::talk_stranger_friendly, dialogue_chatbin::talk_stranger_neutral, dialogue_chatbin::talk_stranger_scared, dialogue_chatbin::talk_stranger_wary, and dialogue_chatbin::talk_wake_up.
Referenced by dialogue::add_topic().
|
overridevirtual |
Reimplemented from Character.
Definition at line 3740 of file npc.cpp.
References Character::get_thirst(), stomach_contents::get_water(), and Character::stomach.
Referenced by address_needs(), complain(), consume_food(), consume_food_from_camp(), decide_needs(), process_turn(), and value().
| std::string npc::get_unique_id | ( | ) | const |
Definition at line 3525 of file npc.cpp.
References unique_id.
Referenced by jmapgen_remove_npcs::apply(), debug_menu::character_edit_menu(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_guard_pos(), and talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_run_npc_eocs().
| void npc::go_to_omt_destination | ( | ) |
Definition at line 4945 of file npcmove.cpp.
References add_msg_debug, ai_cache, talk_function::assign_guard(), debugmode::DF_NPC, Creature::get_location(), get_map(), Character::get_name(), get_path_avoid(), get_pathfinding_settings(), map::getlocal(), Creature::global_omt_location(), goal, npc_short_term_cache::guard_pos, is_player_ally(), move_pause(), move_to_next(), no_goal_point, Character::omt_path, map::passable(), path, point, map::points_in_radius(), Creature::pos(), reach_omt_destination(), map::route(), SEEX, SEEY, set_omt_destination(), coords::coord_point_base< Point >::to_string_writable(), coords::coord_point_mut< Point, Subpoint, InBounds >::x(), coords::coord_point< Point, Origin, Scale, InBounds >::xy(), and coords::coord_point_mut< Point, Subpoint, InBounds >::y().
Referenced by execute_action().
| tripoint npc::good_escape_direction | ( | bool | include_pos = true | ) |
Definition at line 260 of file npcmove.cpp.
References add_msg_debug, ai_cache, allow_bash, npc_personality::bravery, can_move_to(), debugmode::DF_NPC_MOVEAI, displace_XY(), Character::fac_id, map::field_at(), follow_close, follow_distance(), Character::get_int(), Creature::get_location(), zone_manager::get_manager(), get_map(), zone_manager::get_nearest(), get_player_character(), map::getlocal(), npc_follower_rules::has_flag(), Creature::is_dangerous_field(), is_player_ally(), MAX_FLOAT, mem_combat, Character::name, npc_threat_dir, one_in(), op_of_u, npc_combat_memory_cache::panic, path, personality, Creature::pos(), Creature::pos_bub(), random_entry(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), npc_combat_memory_cache::repositioning, rl_dist(), rng(), rules, npc_short_term_cache::threat_map, npc_opinion::trust, update_path(), coords::coord_point_mut< Point, Subpoint, InBounds >::x(), tripoint::x, coords::coord_point_mut< Point, Subpoint, InBounds >::y(), tripoint::y, tripoint::z, and zone_type_NPC_RETREAT.
Referenced by execute_action(), and move().
| bool npc::guaranteed_hostile | ( | ) | const |
Is enemy or will turn into one (can't be convinced not to attack).
Definition at line 2312 of file npc.cpp.
References is_enemy(), faction_template::likes_u, and Character::my_fac.
Referenced by anonymous_namespace{math_parser_diag.cpp}::_friend_match_filter_character(), basic_symbol_color(), target_ui::confirm_non_enemy_target(), extended_description(), move(), and on_attacked().
| void npc::guard_current_pos | ( | ) |
Definition at line 5015 of file npcmove.cpp.
References Creature::get_location(), Creature::global_omt_location(), goal, and guard_pos.
Referenced by set_omt_destination().
| void npc::handle_sound | ( | sounds::sound_t | priority, |
| const std::string & | description, | ||
| int | heard_volume, | ||
| const tripoint & | spos | ||
| ) |
Definition at line 1256 of file npctalk.cpp.
References dangerous_sound::abs_pos, sounds::activity, add_msg_debug, ai_cache, sounds::alarm, sounds::alert, chat_snippets(), creature_tracker::creature_at(), sounds::destructive_activity, debugmode::DF_NPC, Character::disp_name(), Character::fac_id, get_attitude(), get_attitude_group(), get_creature_tracker(), Creature::get_location(), zone_manager::get_manager(), get_map(), Character::get_name(), get_player_character(), map::getglobal(), zone_manager::has(), has_faction_relationship(), npc_follower_rules::has_flag(), hostile, ignore_noise, Character::in_vehicle, is_ally(), is_hallucination(), Character::is_npc(), is_player_ally(), npc_factions::knows_your_voice, sounds::movement, NPC_MISSION_GUARD_ALLY, NPC_MISSION_GUARD_PATROL, sounds::order, Creature::pos(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), rl_dist(), rng(), rules, say(), Character::sees(), npc_short_term_cache::sound_alerts, sounds::speech, npc_short_term_cache::total_danger, dangerous_sound::type, dangerous_sound::volume, warn_about(), coords::coord_point_mut< Point, Subpoint, InBounds >::x(), coords::coord_point_mut< Point, Subpoint, InBounds >::y(), zone_type_NPC_INVESTIGATE_ONLY, and zone_type_NPC_NO_INVESTIGATE.
Referenced by sounds::process_sound_markers().
| bool npc::has_activity | ( | ) | const |
Definition at line 3541 of file npc.cpp.
References attitude, NPC_MISSION_ACTIVITY, and NPCATT_ACTIVITY.
Referenced by talker_npc::get_topics().
| bool npc::has_companion_mission | ( | ) | const |
Definition at line 3485 of file npc.cpp.
References comp_mission, mission_id::id, npc_companion_mission::miss_id, and No_Mission.
Referenced by faction_manager::display(), faction_display(), is_ally(), and talk_function::stop_guard().
| bool npc::has_faction_relationship | ( | const Character & | you, |
| npc_factions::relationship | flag | ||
| ) | const |
Definition at line 2249 of file npc.cpp.
References Character::get_faction(), faction::has_relationship(), faction_template::id, and Character::my_fac.
Referenced by assess_danger(), attitude_to(), handle_sound(), and would_take_that().
| bool npc::has_healing_item | ( | healing_options | try_to_fix | ) |
Definition at line 2146 of file npc.cpp.
References get_healing_item(), and item::is_null().
| healing_options npc::has_healing_options | ( | ) |
Definition at line 2151 of file npc.cpp.
References healing_options::set_all().
Referenced by address_needs().
| healing_options npc::has_healing_options | ( | healing_options | try_to_fix | ) |
Definition at line 2158 of file npc.cpp.
References ABORT, healing_options::bandage, heal_actor::bandages_power, heal_actor::bite, healing_options::bite, heal_actor::bleed, healing_options::bleed, healing_options::clear_all(), healing_options::disinfect, heal_actor::disinfectant_power, itype::get_use(), heal_actor::infect, healing_options::infect, NEXT, item::type, Character::use(), and Character::visit_items().
|
inlineoverridevirtual |
| bool npc::has_item_whitelist | ( | ) | const |
Definition at line 7219 of file npctalk.cpp.
References is_player_ally(), npc_follower_rules::pickup_whitelist, and rules.
Referenced by find_item(), item_name_whitelisted(), item_whitelisted(), and wants_take_that().
|
inline |
Definition at line 1316 of file npc.h.
References job_data::has_job(), and job.
Referenced by faction_display(), basecamp::job_assignment_ui(), and move().
| bool npc::has_omt_destination | ( | ) | const |
Definition at line 4790 of file npcmove.cpp.
References goal, and no_goal_point.
Referenced by address_player(), and long_term_goal_action().
| bool npc::has_painkiller | ( | ) |
Definition at line 2227 of file npc.cpp.
References Creature::get_pain(), and Character::inv.
Referenced by address_needs().
| bool npc::has_player_activity | ( | ) | const |
is performing a player_activity
Definition at line 2376 of file npc.cpp.
References Character::activity, attitude, NPC_MISSION_ACTIVITY, and NPCATT_ACTIVITY.
Referenced by talk_function::assign_camp(), talk_function::assign_guard(), talk_function::find_mount(), and move().
| void npc::heal_player | ( | Character & | patient | ) |
Definition at line 4328 of file npcmove.cpp.
References _, ACT_FIRSTAID, add_msg(), ai_cache, npc_short_term_cache::can_heal, Character::consume_charges(), debugmsg, Character::disp_name(), get_healing_item(), get_player_view(), Character::has_activity(), itype::invoke(), is_hallucination(), item::is_null(), move_to_next(), Creature::pos(), pretend_heal(), rl_dist(), viewer::sees(), item::type, and update_path().
Referenced by execute_action().
| void npc::heal_self | ( | ) |
Definition at line 4374 of file npcmove.cpp.
References _, ACT_FIRSTAID, add_msg_if_player_sees(), ai_cache, item::ammo_consume(), item::ammo_required(), item::ammo_sufficient(), use_function::call(), npc_short_term_cache::can_heal, Character::consume_charges(), debugmsg, Character::disp_name(), effect_asthma, filter, get_healing_item(), itype::get_use(), item::get_use(), Character::has_activity(), Creature::has_effect(), itype::invoke(), item::is_medication(), item::is_null(), visitable::items_with(), Creature::pos(), item::tname(), item::type, and warn_about().
Referenced by execute_action().
| int npc::hostile_anger_level | ( | ) | const |
Definition at line 1621 of file npc.cpp.
References npc_personality::aggression, npc_opinion::fear, op_of_u, and personality.
Referenced by talker_npc::check_hostile_response(), and turned_hostile().
| std::pair< std::string, nc_color > npc::hp_description | ( | ) | const |
Definition at line 3417 of file npc.cpp.
References _, c_green, c_light_green, c_light_red, c_red, c_yellow, Character::hp_percentage(), and Character::male.
Referenced by faction_display().
|
inlineoverridevirtual |
| void npc::import_and_clean | ( | const cata_path & | path | ) |
Read json and apply post-import cleanup.
Definition at line 1734 of file savegame.cpp.
References chkversion(), json_loader::from_path_at_offset(), JsonValue::get_object(), and path.
|
private |
Definition at line 1742 of file savegame.cpp.
References Character::activity, Character::activity_vehicle_part_index, assigned_camp, Character::backlog, Character::camps, chair_pos, chatbin, inventory::clear(), Character::clear_destination(), companion_mission_inv, companion_mission_points, companion_mission_role_id, companion_mission_time, companion_mission_time_ret, complaints, Character::consumption_history, current_activity_id, deserialize(), Creature::effects, g, Creature::get_location(), goal, guard_pos, Character::in_vehicle, job, Character::known_traps, last_player_seen_pos, Character::last_sleep_check, Creature::last_updated, Creature::lifespan_end, mission, dialogue_chatbin::mission_selected, dialogue_chatbin::missions, dialogue_chatbin::missions_assigned, Character::omt_path, previous_mission, pulp_location, Character::queued_effect_on_conditions, reset_companion_mission(), Creature::set_location(), Character::setID(), Character::stashed_outbounds_activity, Character::stashed_outbounds_backlog, unique_id, wander_pos, and Character::warning_record.
| int npc::indoor_voice | ( | ) | const |
Definition at line 1768 of file npc.cpp.
References clamp(), effect_sleep, get_cached_friends(), get_player_character(), Character::get_shout_volume(), Creature::has_effect(), is_ally(), is_enemy(), is_following(), player, Creature::pos(), rl_dist(), and Character::sees().
Referenced by say().
| void npc::invalidate_range_cache | ( | ) |
Definition at line 1383 of file npc.cpp.
References confident_range_cache, confident_shoot_range(), Character::get_wielded_item(), item::is_gun(), Character::most_accurate_aiming_method_limit(), item::reach_range(), and Character::weapon.
Referenced by assess_danger(), talker_npc::clear_ai_rule(), move(), talker_npc::set_ai_rule(), talker_npc::toggle_ai_rule(), and wield().
| bool Character::invoke_item |
As above two, but with position equal to current position.
Definition at line 1928 of file character.cpp.
|
overridevirtual |
As above two, but with position equal to current position.
Reimplemented from Character.
Definition at line 3231 of file npc.cpp.
References Character::invoke_item().
| bool Character::invoke_item |
Definition at line 1929 of file character.cpp.
| bool Character::invoke_item |
As above, but with a pre-selected method.
Debugmsg if this item doesn't have this method.
Definition at line 1925 of file character.cpp.
Asks how to use the item (if it has more than one use_method) and uses it.
Returns true if it destroys the item. Consumes charges from the item. Multi-use items are ONLY supported when all use_methods are iuse_actor!
Reimplemented from Character.
Definition at line 3214 of file npc.cpp.
References Character::invoke_item(), item::type, and itype::use_methods.
| bool Character::invoke_item |
Asks how to use the item (if it has more than one use_method) and uses it.
Returns true if it destroys the item. Consumes charges from the item. Multi-use items are ONLY supported when all use_methods are iuse_actor!
Definition at line 1923 of file character.cpp.
|
overridevirtual |
Reimplemented from Character.
Definition at line 3226 of file npc.cpp.
References Character::invoke_item().
| bool npc::is_active | ( | ) | const |
Definition at line 2529 of file npc.cpp.
References creature_tracker::creature_at(), get_creature_tracker(), and Creature::pos().
Referenced by talk_function::companion_return(), do_player_activity(), and anonymous_namespace{do_turn.cpp}::overmap_npc_move().
|
overridevirtual |
Implements Character.
Definition at line 2260 of file npc.cpp.
References attitude, Character::faction_api_version, faction_your_followers, get_attitude(), get_attitude_group(), get_faction(), get_player_character(), Character::getID(), has_companion_mission(), faction_template::id, is_ally(), Creature::is_avatar(), Character::my_fac, NPC_MISSION_ACTIVITY, NPC_MISSION_GUARD_ALLY, NPC_MISSION_TRAVELLING, NPCATT_FOLLOW, NPCATT_LEAD, and NPCATT_WAIT.
Referenced by handle_sound(), indoor_voice(), avatar::is_ally(), is_ally(), is_friendly(), is_obeying(), is_player_ally(), move(), iuse::play_game(), talker_character_const::spell_training_text(), and talker_character_const::style_training_text().
|
inlineoverridevirtual |
| bool npc::is_dead | ( | ) | const |
Definition at line 2746 of file npc.cpp.
References dead, and Character::is_dead_state().
Referenced by jmapgen_remove_npcs::apply(), die(), and on_attacked().
|
inlineoverridevirtual |
Reimplemented from Character.
Definition at line 917 of file npc.h.
References Character::has_trait(), and trait_id.
| bool npc::is_enemy | ( | ) | const |
Definition at line 2352 of file npc.cpp.
References attitude, NPCATT_FLEE, NPCATT_FLEE_TEMP, and NPCATT_KILL.
Referenced by assess_danger(), Character::attitude_to(), attitude_to(), avatar_action::autoattack(), game::find_or_make_stairs(), guaranteed_hostile(), indoor_voice(), talker_npc::is_enemy(), make_angry(), move(), avatar_action::move(), game::npc_menu(), on_attacked(), avatar::steal(), iuse::tazer(), Character::valid_aoe_technique(), game::vertical_move(), and warn_about().
| bool npc::is_following | ( | ) | const |
Definition at line 2327 of file npc.cpp.
References attitude, NPCATT_FOLLOW, and NPCATT_WAIT.
Referenced by extended_description(), get_current_status(), indoor_voice(), talker_npc::is_following(), move(), and talk_function::start_training_seminar().
| bool npc::is_friendly | ( | const Character & | p | ) | const |
Definition at line 2302 of file npc.cpp.
References is_ally(), Creature::is_avatar(), is_player_ally(), and is_walking_with().
Referenced by assess_danger(), vehicle::handle_potential_theft(), talker_npc::is_friendly(), game::npc_menu(), and Character::reach_attack().
| bool npc::is_guarding | ( | ) | const |
Definition at line 2366 of file npc.cpp.
References is_patrolling(), NPC_MISSION_GUARD, and NPC_MISSION_GUARD_ALLY.
Referenced by assess_danger(), get_current_status(), is_stationary(), and reach_omt_destination().
|
inlineoverridevirtual |
Reimplemented from Character.
Definition at line 911 of file npc.h.
References hallucination.
Referenced by address_needs(), game::allies(), alt_attack(), can_move_to(), can_open_door(), npc_attack_throw::can_use(), npc_attack_activate_item::can_use(), die(), avatar::disarm(), talk_function::drop_weapon(), execute_action(), find_corpse_to_pulp(), find_item(), talker_npc::give_item_to(), handle_sound(), heal_player(), move_to(), mug_player(), game::npc_menu(), npc_throw(), on_attacked(), pick_up_item(), say(), set_fac(), smash_ability(), avatar::steal(), npc_attack_gun::use(), and will_accept_from_player().
| bool npc::is_leader | ( | ) | const |
Definition at line 2332 of file npc.cpp.
References attitude, and NPCATT_LEAD.
Referenced by extended_description(), get_current_status(), and talker_npc::get_topics().
| bool npc::is_minion | ( | ) | const |
Trusts you a lot.
Definition at line 2307 of file npc.cpp.
References is_player_ally(), op_of_u, and npc_opinion::trust.
Referenced by will_accept_from_player().
|
inlineoverridevirtual |
|
overridevirtual |
Implements Character.
Definition at line 2322 of file npc.cpp.
References is_ally(), Creature::is_avatar(), is_stationary(), and is_walking_with().
Referenced by avatar::is_obeying().
| bool npc::is_patrolling | ( | ) | const |
Definition at line 2371 of file npc.cpp.
References NPC_MISSION_GUARD_PATROL.
Referenced by get_current_status(), is_guarding(), and reach_omt_destination().
| bool npc::is_player_ally | ( | ) | const |
Definition at line 2297 of file npc.cpp.
References get_player_character(), and is_ally().
Referenced by act_on_danger_assessment(), address_needs(), alt_attack(), assess_danger(), talk_function::assign_guard(), Character::attitude_to(), attitude_to(), basic_symbol_color(), Character::calc_spell_training_cost(), npc_attack_throw::can_use(), npc_attack_activate_item::can_use(), check_or_use_weapon_cbm(), complain(), confidence_mult(), consume_food(), consume_food_from_camp(), avatar::control_npc(), vehicle_part::crew(), do_player_activity(), evaluate_best_attack(), evaluate_best_weapon(), evaluate_character(), extended_description(), find_corpse_to_pulp(), find_item(), form_opinion(), friendly_teacher(), get_monster_faction(), talker_npc::get_topics(), go_to_omt_destination(), good_escape_direction(), handle_sound(), has_item_whitelist(), is_friendly(), is_minion(), talker_npc::is_player_ally(), is_shopkeeper(), long_term_goal_action(), make_angry(), max_credit_extended(), max_willing_to_owe(), move(), move_to(), mutiny(), game::npc_menu(), pick_up_item(), iuse::portable_game(), process_turn(), reach_omt_destination(), recharge_cbm(), regen_ai_cache(), vehicle_part::set_crew(), shop_restock(), smash_ability(), talk_function::start_training_seminar(), talk_function::stop_following(), talk_function::stop_guard(), trade_ui::trade_ui(), game::validate_npc_followers(), wield_better_weapon(), and will_exchange_items_freely().
| bool npc::is_safe | ( | ) | const |
Definition at line 1210 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::total_danger.
Referenced by talker_npc::is_safe().
| bool npc::is_shopkeeper | ( | ) | const |
Definition at line 2027 of file npc.cpp.
References npc_class::get_shopkeeper_items(), is_player_ally(), and myclass.
Referenced by trade_ui::_confirm_trade(), shop_restock(), npc_trading::trade(), trade_ui::trade_ui(), value(), and wants_to_buy().
| bool npc::is_stationary | ( | bool | include_guards = true | ) | const |
Definition at line 2357 of file npc.cpp.
References effect_infection, Creature::has_effect(), is_guarding(), NPC_MISSION_SHELTER, and NPC_MISSION_SHOPKEEP.
Referenced by is_obeying(), move(), regen_ai_cache(), and set_omt_destination().
| bool npc::is_travelling | ( | ) | const |
Definition at line 2381 of file npc.cpp.
References NPC_MISSION_TRAVELLING.
Referenced by reach_omt_destination().
| bool npc::is_walking_with | ( | ) | const |
Definition at line 2317 of file npc.cpp.
References attitude, NPCATT_FOLLOW, NPCATT_LEAD, and NPCATT_WAIT.
Referenced by address_needs(), basic_symbol_color(), execute_action(), find_corpse_to_pulp(), find_item(), follow_distance(), talker_npc::get_topics(), is_friendly(), is_obeying(), move(), and vehicle_part::set_crew().
| bool npc::item_name_whitelisted | ( | const std::string & | to_match | ) |
Definition at line 7224 of file npctalk.cpp.
References BLACKLISTED, auto_pickup::base_settings::check_item(), auto_pickup::npc_settings::create_rule(), has_item_whitelist(), npc_follower_rules::pickup_whitelist, rules, and WHITELISTED.
Referenced by find_item(), and item_whitelisted().
| bool npc::item_whitelisted | ( | const item & | it | ) |
Definition at line 7244 of file npctalk.cpp.
References has_item_whitelist(), item_name_whitelisted(), and item::tname().
Referenced by wants_take_that().
| void npc::learn_ma_styles_from_traits | ( | ) |
Definition at line 723 of file npc.cpp.
References Character::get_mutations(), Character::martial_arts_data, and rng_get_engine().
Referenced by randomize().
|
protected |
Definition at line 2042 of file savegame_json.cpp.
References activity_id, calendar::before_time_starts, item_pocket::data, faction_id, npc_class::from_legacy_int(), item, Character::load(), member, NPC_MISSION_LEGACY_1, NPC_MISSION_LEGACY_2, NPC_MISSION_LEGACY_3, NPC_MISSION_NULL, NPCATT_LEGACY_1, NPCATT_LEGACY_2, NPCATT_LEGACY_3, NPCATT_LEGACY_4, NPCATT_LEGACY_5, NPCATT_LEGACY_6, NPCATT_NULL, math_opers::pos(), read_legacy_creature_pos(), SEEX, SEEY, calendar::set_location(), tripoint, tripoint_min, calendar::turn_zero, tripoint::x, tripoint::y, and tripoint::z.
| void npc::load_npc_template | ( | const string_id< npc_template > & | ident | ) |
Definition at line 501 of file npc.cpp.
References add_new_mission(), attitude, string_id< T >::c_str(), chatbin, Character::death_eocs, debugmsg, translation::empty(), snippet_library::expand(), Character::fac_id, dialogue_chatbin::first_topic, npc_template::gender_override, Character::getID(), npc_template::guy, idz, Character::male, npc_template::male, miss_ids, mission, myclass, Character::name, npc_template::name_suffix, npc_template::name_unique, npc_templates, pgettext, npc_template::random, randomize(), mission::reserve_new(), set_fac(), SNIPPET, string_format(), dialogue_chatbin::talk_friend, dialogue_chatbin::talk_friend_guard, dialogue_chatbin::talk_leader, dialogue_chatbin::talk_mug, dialogue_chatbin::talk_radio, dialogue_chatbin::talk_stole_item, dialogue_chatbin::talk_stranger_aggressive, dialogue_chatbin::talk_stranger_friendly, dialogue_chatbin::talk_stranger_neutral, dialogue_chatbin::talk_stranger_scared, dialogue_chatbin::talk_stranger_wary, dialogue_chatbin::talk_wake_up, and translation::translated().
| npc_action npc::long_term_goal_action | ( | ) |
Definition at line 2630 of file npcmove.cpp.
References add_msg_debug, attitude, debugmode::DF_NPC, has_omt_destination(), is_player_ally(), npc_goto_destination, NPC_MISSION_SHELTER, NPC_MISSION_SHOPKEEP, NPC_MISSION_TRAVELLING, npc_pause, npc_undecided, set_attitude(), set_mission(), and set_omt_destination().
Referenced by talk_function::leave(), and move().
| void npc::look_for_player | ( | const Character & | sought | ) |
Definition at line 4743 of file npcmove.cpp.
References chat_snippets(), complain_about(), move_to_next(), Creature::pos(), and update_path().
Referenced by execute_action(), and npc_attack_melee::use().
| void npc::make_angry | ( | ) |
Definition at line 1626 of file npc.cpp.
References npc_personality::aggression, npc_personality::bravery, faction_amf, faction_no_faction, npc_opinion::fear, faction_template::id, is_enemy(), is_player_ally(), faction_template::likes_u, min(), mutiny(), Character::my_fac, NPCATT_FLEE_TEMP, NPCATT_KILL, op_of_u, personality, faction_template::respects_u, set_attitude(), and faction_template::trusts_u.
Referenced by Character::disassemble(), talker_npc::get_topics(), vehicle::handle_potential_theft(), talker_npc::make_angry(), avatar_action::move(), mug_player(), and on_attacked().
| int npc::max_credit_extended | ( | ) | const |
Definition at line 1883 of file npc.cpp.
References npc_personality::altruism, npc_opinion::anger, npc_opinion::fear, is_player_ally(), max(), op_of_u, personality, npc_opinion::trust, and npc_opinion::value.
Referenced by trade_ui::_confirm_trade(), and npc_trading::npc_will_accept_trade().
| int npc::max_willing_to_owe | ( | ) | const |
Definition at line 1906 of file npc.cpp.
References npc_personality::altruism, npc_opinion::anger, npc_opinion::fear, is_player_ally(), max(), op_of_u, personality, npc_opinion::trust, and npc_opinion::value.
Referenced by trade_ui::_confirm_trade(), and npc_trading::calc_npc_owes_you().
| npc_action npc::method_of_attack | ( | ) |
Definition at line 1962 of file npcmove.cpp.
References add_msg_debug, ai_cache, npc_short_term_cache::current_attack_evaluation, current_target(), debugmsg, debugmode::DF_NPC, Character::disp_name(), evaluate_best_attack(), npc_do_attack, npc_pause, npc_undecided, prepare_for_combat(), and npc_attack_rating::value().
Referenced by move().
| npc_action npc::method_of_fleeing | ( | ) |
Definition at line 1954 of file npcmove.cpp.
References Character::in_vehicle, npc_flee, and npc_undecided.
Referenced by move().
| int npc::minimum_item_value | ( | ) | const |
Definition at line 2032 of file npc.cpp.
References npc_personality::collector, personality, and cata::hash64_detail::ret.
Referenced by find_item(), mug_player(), and wants_take_that().
| void npc::move | ( | ) |
Definition at line 1301 of file npcmove.cpp.
References act_on_danger_assessment(), ACT_OPERATION, ACT_SPELLCASTING, action, Character::activity, add_msg_debug, address_needs(), address_player(), npc_personality::aggression, ai_cache, Character::assign_stashed_activity(), assigned_camp, attitude, anonymous_namespace{npcmove.cpp}::avoidance_vehicles_radius, npc_personality::bravery, map::bub_from_abs(), Character::check_outbounds_activity(), cleanup_on_no_danger(), compare_sound_alert(), confident_range_cache, current_target(), npc_short_term_cache::danger, npc_short_term_cache::dangerous_explosives, Character::destination_point, debugmode::DF_NPC, Creature::disp_name(), effect_asthma, effect_npc_fire_bad, effect_npc_flee_player, effect_npc_run_away, execute_action(), npc_opinion::fear, fetching_item, find_item(), find_job_to_perform(), follow_close, follow_distance(), g, Character::get_auto_move_route(), Creature::get_location(), get_map(), Character::get_name(), get_player_character(), Character::get_stashed_activity(), Character::get_wielded_item(), Creature::global_omt_location(), goal, good_escape_direction(), goto_to_this_pos, guaranteed_hostile(), npc_short_term_cache::guard_pos, Character::has_charges(), Character::has_destination_activity(), Creature::has_effect(), npc_follower_rules::has_flag(), has_job(), has_new_items, has_player_activity(), Character::has_stashed_activity(), Character::has_trait(), player_activity::id(), Character::in_vehicle, invalidate_range_cache(), is_ally(), is_enemy(), is_following(), is_player_ally(), is_stationary(), is_walking_with(), itype_inhaler, itype_oxygen_tank, itype_smoxygen_tank, long_term_goal_action(), method_of_attack(), method_of_fleeing(), move_to(), move_to_next(), mutiny(), npc_action_name(), npc_escape_explosion, npc_follow_embarked, npc_follow_player, npc_goto_destination, npc_goto_to_this_pos, npc_heal, npc_investigate_sound, NPC_MISSION_NULL, npc_pause, npc_pickup, npc_player_activity, npc_return_to_guard_pos, npc_undecided, npc_worker_downtime, NPCATT_ACTIVITY, NPCATT_FLEE, NPCATT_FLEE_TEMP, NPCATT_FOLLOW, NPCATT_KILL, NPCATT_NULL, calendar::once_every(), op_of_u, path, personality, Creature::pos(), Creature::posz(), print_action(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), regen_ai_cache(), revert_after_activity(), rl_dist(), rules, npc_short_term_cache::s_abs_pos, scan_new_items(), Character::sees(), sees_dangerous_field(), set_attitude(), Creature::set_moves(), npc_short_term_cache::sound_alerts, Character::start_destination_activity(), npc_short_term_cache::stuck, npc_short_term_cache::target, trait_IGNORE_SOUND, update_path(), vehicle_danger(), Character::weapon, coords::coord_point_mut< Point, Subpoint, InBounds >::x(), tripoint::x, coords::coord_point_mut< Point, Subpoint, InBounds >::y(), and tripoint::y.
| void npc::move_away_from | ( | const std::vector< sphere > & | spheres, |
| bool | no_bashing = false |
||
| ) |
Definition at line 3425 of file npcmove.cpp.
References tripoint_range< Tripoint >::begin(), tripoint_range< Tripoint >::end(), get_map(), max(), min(), map::move_cost(), move_cost, Creature::pos(), rl_dist(), cata::sort_by_rating(), tripoint::x, and tripoint::y.
| void npc::move_away_from | ( | const tripoint & | p, |
| bool | no_bash_atk = false, |
||
| std::set< tripoint > * | nomove = nullptr |
||
| ) |
Definition at line 3222 of file npcmove.cpp.
References abs(), can_move_to(), map::combined_movecost(), get_map(), get_player_character(), move_to(), one_in(), map::points_in_radius(), Creature::pos(), tripoint::x, tripoint::y, and tripoint::z.
Referenced by escape_explosion(), move_to(), game::npc_menu(), and game::vertical_move().
| void npc::move_pause | ( | ) |
Definition at line 3372 of file npcmove.cpp.
References activate_bionic_by_id(), aim(), bio_soporific, deactivate_bionic_by_id(), effect_onfire, Character::get_wielded_item(), Creature::has_effect(), anonymous_namespace{npcmove.cpp}::health_cbms, min(), Creature::moves, calendar::once_every(), Character::pause(), and wield_better_weapon().
Referenced by alt_attack(), avoid_friendly_fire(), execute_action(), go_to_omt_destination(), move_to(), move_to_next(), pick_up_item(), npc_attack_melee::use(), npc_attack_gun::use(), npc_attack_throw::use(), use_painkiller(), and worker_downtime().
| void npc::move_to | ( | const tripoint & | p, |
| bool | no_bashing = false, |
||
| std::set< tripoint > * | nomove = nullptr |
||
| ) |
Definition at line 2882 of file npcmove.cpp.
References _, Creature::add_effect(), add_msg_if_npc(), Creature::attack_air(), attitude, attitude_to(), map::bash(), map::bash_rating(), map::board_vehicle(), map::bub_from_abs(), doors::can_unlock_door(), ceil(), chat_snippets(), doors::close_door(), close_doors, map::combined_movecost(), could_move_onto(), creature_tracker::creature_at(), map::creature_in_field(), map::creature_on_trap(), Character::destination_point, effect_bouldering, effect_no_sight, effect_psi_stunned, effect_stumbled_into_invisible, effect_stunned, Creature::facing, field_fd_last_known, Character::get_auto_move_route(), get_creature_tracker(), Character::get_dex(), map::get_dir_circle(), get_map(), Character::get_name(), get_player_character(), Character::get_speed(), Character::get_weight(), Character::has_destination_activity(), Creature::has_effect(), map::has_field_at(), npc_follower_rules::has_flag(), map::has_flag(), map::has_flag_ter_or_furn(), map::has_vehicle_floor(), Creature::HOSTILE, Character::in_sleep_state(), Character::in_vehicle, Creature::is_avatar(), map::is_bashable(), is_hallucination(), Character::is_mounted(), map::is_outside(), is_player_ally(), LEFT, doors::lock_door(), lock_doors, m_neutral, Character::make_footstep_noise(), MAX_RECOIL, Character::melee_attack(), Creature::mod_moves(), mon_flag_RIDEABLE_MECH, Character::mounted_creature, move_away_from(), Character::move_effects(), Character::move_in_vehicle(), move_pause(), NPCATT_ACTIVITY, NPCATT_FLEE_TEMP, NPCATT_KILL, NPCATT_MUG, NPCATT_WAIT_FOR_LEAVE, one_in(), map::open_door(), optional_vpart_position::part_with_feature(), map::passable(), path, Creature::pos(), Creature::pos_bub(), Creature::posx(), Creature::posy(), Creature::posz(), coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), Character::recoil, Creature::remove_effect(), RIGHT, rl_dist(), rng(), rules, Character::run_cost(), say(), Character::sees(), sees_dangerous_field(), set_attitude(), Creature::set_moves(), Creature::setpos(), smash_ability(), Creature::stumble_invis(), map::tername(), TFLAG_CLIMBABLE, TFLAG_DOOR, TFLAG_NO_SIGHT, TFLAG_UNSTABLE, trigdist, map::unboard_vehicle(), doors::unlock_door(), update_path(), map::veh_at(), veh_pointer_or_null(), VPFLAG_BOARDABLE, VPFLAG_CARGO, warn_about(), tripoint::x, tripoint::y, and tripoint::z.
Referenced by avoid_friendly_fire(), execute_action(), move(), move_away_from(), and move_to_next().
| void npc::move_to_next | ( | ) |
Definition at line 3148 of file npcmove.cpp.
References add_msg_debug, debugmode::DF_NPC, move_pause(), move_to(), path, and Creature::pos().
Referenced by address_needs(), alt_attack(), execute_action(), go_to_omt_destination(), heal_player(), look_for_player(), move(), mug_player(), pick_up_item(), reach_omt_destination(), npc_attack_melee::use(), and worker_downtime().
| void npc::mug_player | ( | Character & | mark | ) |
Definition at line 4660 of file npcmove.cpp.
References _, add_msg(), npc_personality::aggression, npc_personality::bravery, Character::can_pickVolume(), Character::can_pickWeight(), Character::cash, chat_snippets(), npc_personality::collector, npc_opinion::fear, Character::get_name(), get_player_character(), Character::get_pseudo_items(), Character::get_speed(), Character::i_add(), Character::i_rem(), Character::is_armed(), is_hallucination(), Character::is_npc(), visitable::items_with(), m_bad, make_angry(), minimum_item_value(), Creature::mod_moves(), move_to_next(), NPCATT_FLEE_TEMP, one_in(), op_of_u, personality, Creature::pos(), Character::pseudo_items, rl_dist(), rng(), say(), Character::sees(), set_attitude(), Creature::set_moves(), item::tname(), update_path(), npc_opinion::value, and value().
Referenced by execute_action().
| void npc::mutiny | ( | ) |
Definition at line 1540 of file npc.cpp.
References _, add_msg(), npc_opinion::anger, assigned_camp, chatbin, job_data::clear_all_priorities(), Character::disp_name(), faction_amf, dialogue_chatbin::first_topic, g, get_player_view(), Character::getID(), is_player_ally(), job, faction_template::known_by_u, faction_template::likes_u, m_bad, max(), Character::my_fac, NPCATT_NULL, op_of_u, sounds::order, Creature::pos(), faction_template::respects_u, say(), viewer::sees(), set_attitude(), set_fac(), dialogue_chatbin::talk_stranger_neutral, npc_opinion::trust, and faction_template::trusts_u.
Referenced by basecamp::feed_workers(), form_opinion(), make_angry(), and move().
| std::string npc::name_and_activity | ( | ) | const |
Definition at line 3771 of file npc.cpp.
References _, current_activity_id, get_current_activity(), Character::get_name(), and string_format().
Referenced by game::chat(), and name_and_maybe_activity().
|
overridevirtual |
Reimplemented from Character.
Definition at line 3781 of file npc.cpp.
References name_and_activity().
| void npc::npc_dismount | ( | ) |
Definition at line 2460 of file npc.cpp.
References add_msg_debug, debugmode::DF_NPC, Character::disp_name(), effect_controlled, effect_ridden, effect_riding, g, get_map(), Character::get_speed(), Character::get_wielded_item(), Creature::has_effect(), Creature::mod_moves(), mon_flag_RIDEABLE_MECH, Character::mounted_creature, points_in_radius(), Creature::pos(), Creature::remove_effect(), item_location::remove_item(), and Creature::setpos().
Referenced by talk_function::dismount().
| void npc::npc_update_body | ( | ) |
Update body, but throttled.
Definition at line 3062 of file npc.cpp.
References Creature::last_updated, calendar::once_every(), calendar::turn, and Character::update_body().
| void npc::on_attacked | ( | const Creature & | attacker | ) |
Definition at line 1650 of file npc.cpp.
References die(), guaranteed_hostile(), hit_by_player, Creature::is_avatar(), is_dead(), is_enemy(), is_hallucination(), and make_angry().
Referenced by monster::attack_at(), avatar::disarm(), game::npc_menu(), Character::on_hit(), projectile_attack(), avatar::steal(), and iuse::tazer().
| void npc::on_load | ( | ) |
Retroactively update npc.
Definition at line 3070 of file npc.cpp.
References Character::activity, Creature::add_effect(), add_msg_debug, map::board_vehicle(), Character::calc_focus_equilibrium(), debugmode::DF_NPC, Character::disp_name(), effect_bouldering, effect_riding, Creature::effects, Character::focus_equilibrium_sleepiness_cap(), Character::focus_pool, g, get_creature_tracker(), effect::get_duration(), get_map(), Character::get_name(), hallucination, Character::has_destination(), Creature::has_effect(), map::has_flag(), has_new_items, Character::has_trait(), map::has_vehicle_floor(), Character::in_vehicle, Creature::last_updated, effect_on_conditions::load_existing_character(), min(), Creature::mod_moves(), Character::mounted_creature, Creature::pos(), Creature::pos_bub(), Character::process_effects(), Character::process_items(), Creature::remove_effect(), effect::set_duration(), shop_restock(), TFLAG_UNSTABLE, trait_HALLUCINATION, calendar::turn, calendar::turn_zero, Character::update_body(), Character::update_mental_focus(), map::veh_at(), and VPFLAG_BOARDABLE.
Referenced by game::load_npcs().
|
overrideprotectedvirtual |
Reimplemented from Character.
Definition at line 960 of file npc.cpp.
References debugmsg, overmap::erase_npc(), g, overmapbuffer::get(), Creature::get_location(), Character::get_name(), Character::getID(), overmap::insert_npc(), Creature::is_fake(), Character::on_move(), overmap_buffer, unique_id, and coords::coord_point< Point, Origin, Scale, InBounds >::xy().
| void npc::on_unload | ( | ) |
Do some cleanup and caching as npc is being unloaded from map.
Definition at line 3057 of file npc.cpp.
Referenced by game::unload_npcs().
| std::string npc::opinion_text | ( | ) | const |
Definition at line 2651 of file npc.cpp.
References _, npc_opinion::anger, npc_opinion::fear, op_of_u, cata::hash64_detail::ret, string_format(), npc_opinion::trust, and npc_opinion::value.
Referenced by talker_npc::opinion_text().
| healing_options npc::patient_assessment | ( | const Character & | c | ) |
Definition at line 2381 of file npcmove.cpp.
References healing_options::bandage, healing_options::bite, healing_options::bleed, body_part_head, body_part_torso, c, healing_options::clear_all(), healing_options::disinfect, effect_bandaged, effect_bite, effect_bleed, effect_disinfected, effect_infected, healing_options::infect, min(), and only_main.
Referenced by address_needs().
| std::string npc::pick_talk_topic | ( | const Character & | u | ) |
Definition at line 7159 of file npctalk.cpp.
References npc_personality::aggression, npc_personality::altruism, npc_personality::bravery, chatbin, npc_opinion::fear, NPCATT_MUG, NPCATT_NULL, op_of_u, personality, set_attitude(), dialogue_chatbin::talk_mug, dialogue_chatbin::talk_stranger_aggressive, dialogue_chatbin::talk_stranger_friendly, dialogue_chatbin::talk_stranger_neutral, dialogue_chatbin::talk_stranger_scared, dialogue_chatbin::talk_stranger_wary, and npc_opinion::trust.
Referenced by talker_npc::get_topics().
| void npc::pick_up_item | ( | ) |
Definition at line 3655 of file npcmove.cpp.
References _, add_msg(), add_msg_debug, allow_pick_up, debugmode::DF_NPC, debugmode::DF_NPC_ITEMAI, map::examine(), fetching_item, g, get_map(), Character::get_name(), get_player_view(), Character::get_speed(), anonymous_namespace{npcmove.cpp}::good_for_pickup(), npc_follower_rules::has_flag(), map::has_items(), has_new_items, Character::i_add(), is_hallucination(), map::is_harvestable(), is_player_ally(), Creature::mod_moves(), move_pause(), move_to_next(), nearest_passable(), optional_vpart_position::part_with_feature(), path, pick_up_item_map(), pick_up_item_vehicle(), Creature::pos(), Creature::posx(), Creature::posy(), Creature::posz(), rl_dist(), rules, Character::sees(), viewer::sees(), update_path(), value(), map::veh_at(), VPFLAG_CARGO, wanted_item, wanted_item_pos, worst_item_value, tripoint::x, tripoint::y, tripoint::z, and zone_type_NO_NPC_PICKUP.
Referenced by execute_action().
Picks up items and returns a list of them.
Definition at line 3877 of file npcmove.cpp.
References get_map(), map::i_at(), and npc_pickup_from_stack().
Referenced by pick_up_item().
Definition at line 3883 of file npcmove.cpp.
References vehicle::get_items(), npc_pickup_from_stack(), and vehicle::part().
Referenced by pick_up_item().
| void npc::place_on_map | ( | ) |
Places the NPC on the map.
This update its pos values to fit the current offset of map (g->levx, g->levy). If the square on the map where the NPC would go is not empty a spiral search for an empty square around it is performed.
Definition at line 1015 of file npc.cpp.
References closest_points_first(), debugmsg, g, Character::is_mounted(), Creature::pos(), Creature::posx(), Creature::posy(), Creature::posz(), SEEX, and Creature::setpos().
| void npc::prepare_for_combat | ( | ) |
Definition at line 2369 of file npcmove.cpp.
References activate_combat_cbms(), and activate_combat_items().
Referenced by method_of_attack().
Definition at line 835 of file ranged.cpp.
References _, add_msg_if_player_sees(), debugmsg, Character::disp_name(), Character::get_speed(), gun, item::gun_noise(), m_info, m_warning, Creature::mod_moves(), one_in(), Creature::pos(), item::sound_data::sound, and Character::weapon.
Referenced by execute_action(), and npc_attack_gun::use().
Definition at line 4365 of file npcmove.cpp.
References _, add_msg_if_player_sees(), Character::consume_charges(), Character::disp_name(), Character::get_speed(), and Creature::mod_moves().
Referenced by heal_player().
|
overridevirtual |
Reimplemented from Character.
Definition at line 2910 of file npc.cpp.
References marked_for_death, Character::prevent_death(), and prevent_death_reminder.
|
overridevirtual |
Write information about this creature.
| w | the window to print the text into. |
| vStart | vertical start to print, that means the first line to print. |
| vLines | number of lines to print at most (printing less is fine). |
| column | horizontal start to print (column), horizontal end is one character before the right border of the window (to keep the border). |
Implements Creature.
Definition at line 2572 of file npc.cpp.
References _, attitude_to(), basic_symbol_color(), c_green, c_light_gray, c_red, c_white, c_yellow, enumerate_as_string(), fold_and_print(), foldstring(), get_attitude(), Creature::get_attitude_ui_data(), get_hp_bar(), Character::get_mutation_visibility_cap(), Character::get_name(), get_player_character(), Character::get_visible_worn_items(), Character::get_wielded_item(), catacurses::getmaxx(), Character::hp_percentage(), Character::is_armed(), line, mvwprintz(), npc_attitude_name(), point, Character::sees(), Character::symbol_color(), trim_and_print(), utf8_width(), Character::visible_mutations(), and wprintz().
|
overridevirtual |
Handles end-of-turn processing.
Reimplemented from Character.
Definition at line 3181 of file npc.cpp.
References npc_opinion::anger, npc_opinion::fear, Character::get_hunger(), Creature::get_pain(), Character::get_stamina(), Character::get_stamina_max(), get_thirst(), Character::hp_percentage(), is_player_ally(), max(), calendar::once_every(), op_of_u, Character::process_turn(), Character::set_stamina(), npc_opinion::trust, npc_opinion::value, and x_in_y().
|
overridevirtual |
| void npc::randomize | ( | const npc_class_id & | type = npc_class_id::NULL_ID(), |
| const npc_template_id & | tem_id = npc_template_id::NULL_ID() |
||
| ) |
Definition at line 551 of file npc.cpp.
References Character::add_bionic(), Character::add_proficiency(), npc_template::age, npc_personality::aggression, npc_personality::altruism, npc_personality::bravery, chi_squared_roll(), clamp(), Character::clear_mutations(), npc_personality::collector, debugmsg, npc_template::dex, Character::dex_max, dice(), g, spell::gain_level(), generate_personality_traits(), Character::get_healthy_kcal(), spell::get_level(), Character::getID(), has_new_items, npc_template::height, Character::int_max, npc_template::intl, Character::inv, spell::is_max_level(), string_id< T >::is_valid(), item, learn_ma_styles_from_traits(), effect_on_conditions::load_new_character(), Character::magic, Character::male, max(), min(), Character::mod_skill_level(), Creature::moves, Character::mutate_category(), myclass, normal_roll(), NPC_MISSION_NULL, NPC_PERSONALITY_MAX, NPC_PERSONALITY_MIN, string_id< npc_class >::NULL_ID(), string_id< T >::obj(), one_in(), npc_template::per, Character::per_max, personality, npc_template::personality, Character::pick_name(), Character::prof, npc_class::random_common(), Character::randomize_height(), Character::recalc_hp(), rng(), npc_class::roll_aggression(), npc_class::roll_altruism(), npc_class::roll_bravery(), npc_class::roll_collector(), npc_class::roll_dexterity(), npc_class::roll_intelligence(), npc_class::roll_perception(), npc_class::roll_skill(), npc_class::roll_strength(), round(), Character::set_base_age(), Character::set_base_height(), Creature::set_body(), Character::set_mutation(), Character::set_skill_level(), Character::set_stored_kcal(), Character::set_wielded_item(), Character::setID(), skill_speech, Skill::skills, calendar::start_of_cataclysm, starting_clothes(), starting_inv(), starting_weapon(), npc_template::str, Character::str_max, npc_class::traits, trait_group::traits_from(), calendar::turn, calendar::turn_zero, type, and mutation_branch::variant().
Referenced by debug_menu::character_edit_menu(), load_npc_template(), and randomize_from_faction().
| void npc::randomize_from_faction | ( | faction * | fac | ) |
Definition at line 740 of file npc.cpp.
References faction_template::id, string_id< npc_class >::NULL_ID(), randomize(), and set_fac().
| void npc::reach_omt_destination | ( | ) |
Definition at line 4795 of file npcmove.cpp.
References _, add_msg_if_player_sees(), talk_function::assign_guard(), base_location, Character::cache_has_item_with_flag(), Character::disp_name(), flag_TWO_WAY_RADIO, Creature::get_location(), get_map(), get_player_character(), map::getlocal(), Creature::global_omt_location(), goal, guard_pos, is_guarding(), is_patrolling(), is_player_ally(), is_travelling(), m_info, move_to_next(), need_safety, needs, no_goal_point, NPC_MISSION_GUARD, Character::omt_path, path, Creature::pos(), rl_dist(), SEEX, set_mission(), and update_path().
Referenced by go_to_omt_destination(), and travel_overmap().
| void npc::reboot | ( | ) |
Definition at line 2751 of file npc.cpp.
References Character::activity, Creature::add_effect(), ai_cache, npc_short_term_cache::ally, npc_short_term_cache::can_heal, Character::cancel_activity(), lru_cache< Key, Value >::clear(), healing_options::clear_all(), Character::clear_destination(), npc_short_term_cache::danger, npc_short_term_cache::danger_assessment, npc_short_term_cache::dangerous_explosives, effect_npc_suspend, fetching_item, npc_short_term_cache::friends, goal, npc_short_term_cache::guard_pos, guard_pos, has_new_items, last_player_seen_pos, last_seen_player_turn, npc_short_term_cache::my_weapon_value, no_goal_point, NPC_MISSION_NULL, path, patience, npc_short_term_cache::s_abs_pos, npc_short_term_cache::searched_tiles, npc_short_term_cache::sound_alerts, npc_short_term_cache::stuck, npc_short_term_cache::target, npc_short_term_cache::threat_map, npc_short_term_cache::total_danger, tripoint_min, tripoint_zero, wanted_item_pos, and worst_item_value.
| bool npc::recharge_cbm | ( | ) |
Definition at line 2299 of file npcmove.cpp.
References Character::get_bionic_fuels(), Character::get_fueled_bionics(), Character::get_max_power_level(), Character::has_active_bionic(), is_player_ally(), Character::mod_power_level(), and use_bionic_by_id().
Referenced by address_needs().
| void npc::regen_ai_cache | ( | ) |
Definition at line 1215 of file npcmove.cpp.
References ai_cache, npc_short_term_cache::ally, npc_combat_memory_cache::assess_ally, assess_danger(), npc_combat_memory_cache::assess_enemy, npc_short_term_cache::can_heal, chatbin, healing_options::clear_all(), creature_tracker::creature_at(), npc_short_term_cache::danger, npc_short_term_cache::danger_assessment, npc_short_term_cache::dangerous_explosives, effect_npc_fire_bad, effect_npc_player_still_looking, effect_npc_run_away, keycode::end, find_dangerous_explosives(), npc_combat_memory_cache::formation_distance, npc_short_term_cache::friends, get_creature_tracker(), Creature::get_location(), get_map(), get_player_character(), mission::get_type(), Character::get_wielded_item(), Character::getID(), map::getlocal(), Creature::global_omt_location(), mission_type::goal, goal, npc_short_term_cache::guard_pos, Creature::has_effect(), Character::has_trait(), npc_short_term_cache::hostile_guys, mission::is_complete(), is_player_ally(), is_stationary(), known_stolen_item, mem_combat, MGOAL_FIND_ANY_ITEM, MGOAL_FIND_ITEM, MGOAL_FIND_ITEM_GROUP, dialogue_chatbin::missions_assigned, Character::my_fac, npc_short_term_cache::my_weapon_value, npc_short_term_cache::neutral_guys, NPC_DANGER_VERY_LOW, NPCATT_RECOVER_GOODS, NPCATT_TALK, null_item_reference(), path, npc_combat_memory_cache::reposition_countdown, npc_combat_memory_cache::repositioning, Character::sees(), set_attitude(), npc_short_term_cache::sound_alerts, npc_combat_memory_cache::swarm_count, npc_short_term_cache::target, npc_short_term_cache::total_danger, trait_RETURN_TO_START_POS, warn_about(), Character::weapon, and Character::weapon_value().
Referenced by move().
| void npc::reset_companion_mission | ( | ) |
Unset a companion mission. Precondition: !has_companion_mission()
Definition at line 3466 of file npc.cpp.
References comp_mission, npc_companion_mission::destination, npc_companion_mission::miss_id, npc_companion_mission::position, reset_miss_id(), and npc_companion_mission::role_id.
Referenced by talk_function::companion_return(), basecamp::finish_return(), import_and_clean(), and talk_function::stop_guard().
| void npc::revert_after_activity | ( | ) |
Definition at line 927 of file npc.cpp.
References Character::activity, attitude, Character::backlog, Character::clear_destination(), current_activity_id, string_id< activity_type >::NULL_ID(), previous_attitude, and previous_mission.
Referenced by activity_on_turn_move_loot(), talk_function::assign_camp(), talk_function::assign_guard(), check_npc_revert(), complete_construction(), do_player_activity(), migration_cancel_activity_actor::do_turn(), unload_loot_activity_actor::do_turn(), talk_function::find_mount(), activity_handlers::find_mount_do_turn(), move(), activity_handlers::pulp_finish(), and talk_function::revert_activity().
| bool npc::saw_player_recently | ( | ) | const |
Definition at line 4784 of file npcmove.cpp.
References get_map(), map::inbounds(), last_player_seen_pos, and last_seen_player_turn.
Referenced by execute_action().
|
inline |
Definition at line 1025 of file npc.h.
References line, and string_format().
Referenced by add_msg_player_or_say(), address_player(), complain_about(), do_npc_read(), talk_function::drop_items_in_place(), execute_action(), find_corpse_to_pulp(), find_item(), item::handle_pickup_ownership(), vehicle::handle_potential_theft(), handle_sound(), talk_function::morale_chat_activity(), move_to(), mug_player(), mutiny(), game::npc_menu(), avatar::read(), talker_npc::say(), see_item_say_smth(), and avatar::talk_to().
| void npc::say | ( | const std::string & | line, |
| sounds::sound_t | spriority = sounds::sound_t::speech |
||
| ) | const |
Definition at line 1729 of file npc.cpp.
References _, add_msg(), add_msg_if_player_sees(), sounds::alert, danger_assessment(), Character::get_name(), get_player_character(), Character::get_shout_volume(), Character::has_trait(), indoor_voice(), Character::is_blind(), Character::is_deaf(), is_hallucination(), Character::is_mute(), line, m_warning, Character::male, NPC_DANGER_VERY_LOW, sounds::order, parse_tags(), Creature::pos(), sounds::sound(), sound, sounds::speech, string_format(), and trait_MUTE.
| bool npc::scan_new_items | ( | ) |
Definition at line 4142 of file npcmove.cpp.
References add_msg_debug, debugmode::DF_NPC, Character::get_name(), has_new_items, and wield_better_weapon().
Referenced by move().
| void npc::see_item_say_smth | ( | const itype_id & | object, |
| const std::string & | smth | ||
| ) |
Definition at line 3478 of file npcmove.cpp.
References closest_points_first(), get_map(), map::i_at(), one_in(), Creature::pos(), say(), Character::sees(), and map::sees_some_items().
Referenced by find_item().
|
private |
Definition at line 395 of file npcmove.cpp.
References get_map(), and Creature::is_dangerous_fields().
Referenced by could_move_onto(), get_path_avoid(), move(), and move_to().
|
overridevirtual |
Select suitable ammo with which to reload the item.
| base | Item to select ammo for |
| prompt | force display of the menu even if only one choice |
| empty | allow selection of empty magazines |
Implements Character.
Definition at line 2175 of file npcmove.cpp.
References item::reload_option::ammo, item::ammo_remaining(), Character::list_ammo(), and item::reload_option::moves().
Referenced by do_reload(), find_reloadable(), and find_usable_ammo().
|
overridevirtual |
Implements Character.
Definition at line 2251 of file savegame_json.cpp.
References JsonOut::end_object(), and JsonOut::start_object().
Referenced by export_to().
| void npc::set_attitude | ( | npc_attitude | new_attitude | ) |
Definition at line 3551 of file npc.cpp.
References _, Creature::add_effect(), add_msg_debug, add_msg_if_npc(), attitude, debugmode::DF_NPC, effect_npc_flee_player, fearful, get_attitude_group(), Character::get_name(), get_player_view(), Creature::has_effect(), hostile, Creature::is_fake(), m_bad, m_good, m_warning, npc_attitude_id(), NPCATT_FLEE, NPCATT_FLEE_TEMP, previous_attitude, and Character::sees().
Referenced by address_player(), Character::assign_activity(), talk_function::assign_camp(), talk_function::assign_guard(), debug_menu::character_edit_menu(), talk_function::drop_stolen_item(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_npc_goal(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_wants_to_talk(), talk_function::flee(), talk_function::follow(), talk_function::follow_only(), form_opinion(), vehicle_part::get_targeting_npc(), talk_function::goto_location(), talk_function::hostile(), talk_function::insult_combat(), talk_function::lead_to_safety(), talk_function::leave(), npc_template::load(), long_term_goal_action(), make_angry(), make_fake_npc(), move(), move_to(), mug_player(), mutiny(), talk_function::npc_thankful(), pick_talk_topic(), mission_start::place_deposit_box(), talk_function::player_leaving(), regen_ai_cache(), talk_function::remove_stolen_status(), game::reset_npc_dispositions(), gun_actor::shoot(), talk_function::start_mugging(), talk_function::stop_following(), talk_function::stop_guard(), talk_function::stranger_neutral(), talker_npc::will_talk_to_u(), and witness_thievery().
| void npc::set_companion_mission | ( | const tripoint_abs_omt & | omt_pos, |
| const std::string & | role_id, | ||
| const mission_id & | miss_id | ||
| ) |
Definition at line 3449 of file npc.cpp.
References comp_mission, npc_companion_mission::miss_id, npc_companion_mission::position, and npc_companion_mission::role_id.
| void npc::set_companion_mission | ( | const tripoint_abs_omt & | omt_pos, |
| const std::string & | role_id, | ||
| const mission_id & | miss_id, | ||
| const tripoint_abs_omt & | destination | ||
| ) |
Definition at line 3457 of file npc.cpp.
References comp_mission, npc_companion_mission::destination, npc_companion_mission::miss_id, npc_companion_mission::position, and npc_companion_mission::role_id.
| void npc::set_companion_mission | ( | npc & | p, |
| const mission_id & | miss_id | ||
| ) |
Set up (start) a companion mission.
Definition at line 3411 of file npc.cpp.
References companion_mission_role_id, and Creature::global_omt_location().
| void npc::set_fac | ( | const faction_id & | id | ) |
Definition at line 747 of file npc.cpp.
References faction::add_to_membership(), apply_ownership_to_inv(), Character::disp_name(), Character::fac_id, g, Character::getID(), faction_template::id, Creature::is_fake(), is_hallucination(), known_to_u, Character::my_fac, and faction::remove_member().
Referenced by avatar::control_npc(), talk_function::follow(), vehicle_part::get_targeting_npc(), talk_function::leave(), load_npc_template(), mutiny(), randomize_from_faction(), game::reset_npc_dispositions(), talker_npc::set_fac(), and update_faction_api().
| void npc::set_faction_ver | ( | int | new_version | ) |
Definition at line 2244 of file npc.cpp.
References Character::faction_api_version.
Referenced by update_faction_api().
| void npc::set_guard_pos | ( | const tripoint_abs_ms & | p | ) |
Definition at line 2859 of file npcmove.cpp.
References ai_cache, and npc_short_term_cache::guard_pos.
Referenced by talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_guard_pos().
| void npc::set_known_to_u | ( | bool | known | ) |
Definition at line 952 of file npc.cpp.
References faction::add_to_membership(), Character::disp_name(), Character::getID(), known_to_u, and Character::my_fac.
Referenced by talker_npc::will_talk_to_u().
| void npc::set_mission | ( | npc_mission | new_mission | ) |
Definition at line 3530 of file npc.cpp.
References Character::activity, current_activity_id, player_activity::id(), mission, NPC_MISSION_ACTIVITY, and previous_mission.
Referenced by Character::assign_activity(), talk_function::assign_camp(), talk_function::assign_guard(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_npc_goal(), talk_function::goto_location(), long_term_goal_action(), reach_omt_destination(), and talk_function::stop_guard().
|
overridevirtual |
Implements Character.
Definition at line 5441 of file npcmove.cpp.
References Character::recalculate_enchantment_cache().
| void npc::set_omt_destination | ( | ) |
Definition at line 4851 of file npcmove.cpp.
References D_INFO, DC_ALL, DebugLog(), decide_needs(), omt_find_params::existing_only, overmapbuffer::find_closest(), overmap_path_params::for_npc(), get_location_for(), Character::get_name(), get_need_str_id(), overmapbuffer::get_travel_path(), oter_t::get_type_id(), Creature::global_omt_location(), npc_need_goal_cache::goal, goal, goal_cache, guard_current_pos(), overmap::invalid_tripoint, is_stationary(), omt_find_params::max_z, omt_find_params::min_z, need_none, needs, no_goal_point, npc_need_goal_cache::omt_loc, Character::omt_path, overmap_buffer, point, rng(), omt_find_params::search_range, string_id< T >::str(), overmapbuffer::ter(), coords::coord_point_base< Point >::to_string(), type, omt_find_params::types, and coords::coord_point_mut< Point, Subpoint, InBounds >::z().
Referenced by talk_function::assign_camp(), talk_function::assign_guard(), go_to_omt_destination(), and long_term_goal_action().
| void npc::set_unique_id | ( | const std::string & | id | ) |
Definition at line 3515 of file npc.cpp.
References debugmsg, g, Creature::get_location(), Character::id, and unique_id.
Referenced by jmapgen_npc::apply().
| void npc::shift | ( | const point & | s | ) |
Definition at line 2738 of file npc.cpp.
References maybe_shift(), path, point, sm_to_ms_copy(), and wanted_item_pos.
| void npc::shop_restock | ( | ) |
Definition at line 1933 of file npc.cpp.
References add_fallback_zone(), consume_items_in_zones(), faction_template::currency, distribute_items_to_npc_zones(), npc_class::get_shop_restock_interval(), npc_class::get_shopkeeper_items(), string_id< T >::is_empty(), item::is_null(), is_player_ally(), is_shopkeeper(), item_group::item_from(), item_group::items_from(), Character::last_item, Character::my_fac, myclass, one_in(), item::price(), random_entry(), restock, cata::hash64_detail::ret, rng(), rng_float(), item::set_owner(), calendar::turn, calendar::turn_zero, and faction_template::wealth.
Referenced by on_load(), and npc_trading::trade().
|
overridevirtual |
Reimplemented from Character.
Definition at line 2491 of file npc.cpp.
References allow_bash, npc_follower_rules::has_flag(), is_hallucination(), is_player_ally(), rules, and Character::smash_ability().
Referenced by can_move_to(), get_pathfinding_settings(), and move_to().
| void npc::spawn_at_omt | ( | const tripoint_abs_omt & | p | ) |
Spawns the NPC on a random square within the given OMT.
| p | global omt coordinates. |
Definition at line 1003 of file npc.cpp.
References coords::map_squares_per(), coords::omt, rng(), and spawn_at_precise().
Referenced by overmapbuffer::fix_npcs(), and travel_overmap().
| void npc::spawn_at_precise | ( | const tripoint_abs_ms & | p | ) |
Spawns the NPC on the specified map square.
Definition at line 1010 of file npc.cpp.
References Creature::set_location().
Referenced by map::rotate(), and spawn_at_omt().
|
overridevirtual |
Returns an approximate number of tiles this creature can travel per turn.
Reimplemented from Character.
Definition at line 3167 of file npc.cpp.
References Character::get_speed(), cata::hash64_detail::ret, and Character::run_cost().
Referenced by npc_attack_spell::base_time_penalty(), npc_attack_throw::evaluate_tripoint(), and find_dangerous_explosives().
| void npc::starting_weapon | ( | const npc_class_id & | type | ) |
Definition at line 1066 of file npc.cpp.
References item::ammo_default(), item::ammo_set(), best_combat_skill(), string_id< T >::c_str(), debugmsg, Character::dex_max, Character::get_dex(), get_event_bus(), get_faction(), Character::get_int(), item::get_min_str(), Character::get_per(), Character::get_str(), Character::get_wielded_item(), Character::getID(), item_group::group_is_defined(), Character::int_max, item::is_gun(), string_id< T >::is_null(), item_group::item_from(), Item_spawn_data_guns_pistol_common, Item_spawn_data_guns_rifle_common, Item_spawn_data_guns_shotgun_common, Item_spawn_data_guns_smg_common, Item_spawn_data_survivor_bashing, Item_spawn_data_survivor_cutting, Item_spawn_data_survivor_stabbing, itype::magazine, item::magazine_default(), Character::meets_stat_requirements(), itype::min_dex, itype::min_int, itype::min_per, Character::per_max, random_item_from(), event_bus::send_with_talker(), item::set_owner(), Character::set_wielded_item(), skill_archery, skill_bashing, skill_cutting, skill_pistol, skill_rifle, skill_shotgun, skill_smg, skill_stabbing, skill_throw, Character::str_max, calendar::turn, type, item::type, item::typeId(), Character::weapon, and WEAPONS_ONLY.
Referenced by randomize().
|
protected |
Definition at line 2260 of file savegame_json.cpp.
References JsonOut::member(), and Character::store().
| void npc::stow_item | ( | item & | it | ) |
Definition at line 1294 of file npc.cpp.
References _, map::add_item_or_charges(), add_msg_if_npc(), Character::can_stash(), deactivate_or_discharge_bionic_weapon(), item_location::get_item(), get_map(), get_player_view(), Character::get_wielded_item(), Character::i_add(), Character::is_using_bionic_weapon(), Character::item_handling_cost(), Character::item_wear_cost(), m_info, Creature::mod_moves(), Creature::pos(), visitable::remove_item(), cata::hash64_detail::ret, viewer::sees(), item::tname(), and Character::wear_item().
Referenced by check_or_use_weapon_cbm(), discharge_cbm_weapon(), dispose_item(), and wield().
Definition at line 3588 of file npc.cpp.
References NC_BOUNTY_HUNTER, NPC_MISSION_GUARD_PATROL, and NPC_MISSION_SHOPKEEP.
Referenced by item::handle_pickup_ownership(), and monster::witness_thievery().
| time_duration npc::time_to_read | ( | const item & | book, |
| const Character & | reader | ||
| ) | const |
Definition at line 1162 of file npc.cpp.
References itype::book, Character::fine_detail_vision_mod(), time_duration::from_seconds(), Character::fun_to_read(), Character::get_int(), Character::get_knowledge_level(), Character::has_trait(), max(), min(), Character::read_speed(), trait_PROF_DICEMASTER, type, and item::type.
Referenced by do_npc_read(), and read_activity_actor::finish().
| bool npc::took_painkiller | ( | ) | const |
Definition at line 2232 of file npc.cpp.
References effect_pkill1_acetaminophen, effect_pkill1_generic, effect_pkill1_nsaid, effect_pkill2, effect_pkill3, effect_pkill_l, and Creature::has_effect().
Referenced by address_needs().
| void npc::travel_overmap | ( | const tripoint_abs_omt & | pos | ) |
Note: this places NPC on a given position in CURRENT MAP coordinates.
Do not use when placing a NPC in mapgen.
Definition at line 981 of file npc.cpp.
References debugmsg, overmap::erase_npc(), overmapbuffer::get(), Character::get_name(), Character::getID(), Creature::global_omt_location(), goal, overmap::insert_npc(), Creature::is_fake(), overmap_buffer, Creature::pos(), reach_omt_destination(), and spawn_at_omt().
| bool npc::turned_hostile | ( | ) | const |
Definition at line 1616 of file npc.cpp.
References npc_opinion::anger, hostile_anger_level(), and op_of_u.
Referenced by talker_npc::turned_hostile().
|
inlineoverridevirtual |
| void npc::update_missions_target | ( | character_id | old_character, |
| character_id | new_character | ||
| ) |
Definition at line 3795 of file npc.cpp.
References chatbin, dialogue_chatbin::missions_assigned, and temp.
| bool npc::update_path | ( | const tripoint & | p, |
| bool | no_bashing = false, |
||
| bool | force = true |
||
| ) |
Tries to find path to p.
If it can, updates path to it.
| p | Destination of pathing |
| no_bashing | Don't allow pathing through tiles that require bashing. |
| force | If there is no valid path, empty the current path. |
Definition at line 2811 of file npcmove.cpp.
References add_msg_debug, ai_cache, debugmode::DF_NPC, force, get_map(), get_path_avoid(), get_pathfinding_settings(), last, path, Creature::pos(), Creature::posx(), Creature::posy(), Creature::posz(), rl_dist(), map::route(), npc_short_term_cache::sound_alerts, tripoint::x, tripoint::y, and tripoint::z.
Referenced by alt_attack(), execute_action(), find_corpse_to_pulp(), find_item(), good_escape_direction(), heal_player(), look_for_player(), move(), move_to(), mug_player(), pick_up_item(), reach_omt_destination(), update_path(), npc_attack_melee::use(), and worker_downtime().
| bool npc::update_path | ( | const tripoint_bub_ms & | p, |
| bool | no_bashing = false, |
||
| bool | force = true |
||
| ) |
Definition at line 2854 of file npcmove.cpp.
References force, coords::coord_point_mut< Point, Subpoint, InBounds >::raw(), and update_path().
| void npc::update_worst_item_value | ( | ) |
| bool npc::use_bionic_by_id | ( | const bionic_id & | cbm_id, |
| bool | eff_only = false |
||
| ) |
Definition at line 2248 of file npcmove.cpp.
References Character::activate_bionic(), and Character::my_bionics.
Referenced by address_needs(), and recharge_cbm().
| void npc::use_painkiller | ( | ) |
Definition at line 4425 of file npcmove.cpp.
References _, add_msg_if_player_sees(), Character::consume(), debugmsg, Character::disp_name(), Character::get_consume_time(), Creature::get_pain(), Character::inv, item::is_null(), Creature::mod_moves(), move_pause(), and item::tname().
Referenced by execute_action().
| double npc::value | ( | const item & | it | ) | const |
Definition at line 2050 of file npc.cpp.
References item::active, flag_BOMB, item::has_flag(), item::is_dangerous(), and item::price().
Referenced by npc_trading::adjusted_price(), find_item(), npc_trading::init_selling(), mug_player(), pick_up_item(), talker_npc::value(), wants_take_that(), wants_to_buy(), wants_to_sell(), and inventory::worst_item_value().
| double npc::value | ( | const item & | it, |
| double | market_price | ||
| ) | const |
Definition at line 2060 of file npc.cpp.
References item::ammo_type(), item::ammo_types(), itype::book, Character::compute_effective_nutrients(), faction_template::currency, islot_book::fun, stomach_contents::get_calories(), item::get_comestible(), Character::get_healthy_kcal(), Character::get_knowledge_level(), Character::get_stored_kcal(), get_thirst(), Character::get_wielded_item(), visitable::has_amount(), Character::has_gun_for_ammo(), item::is_ammo(), item::is_book(), item::is_food(), item::is_gun(), item::is_maybe_melee_weapon(), is_shopkeeper(), item::is_tool(), islot_book::level, min(), Character::my_fac, null_item_reference(), islot_book::req, cata::hash64_detail::ret, round(), islot_book::skill, Character::stomach, item::type, item::typeId(), Character::weapon, Character::weapon_value(), and Character::will_eat().
| float npc::vehicle_danger | ( | int | radius | ) | const |
Definition at line 1573 of file npc.cpp.
References a, abs(), b, units::cos(), tileray::dir(), vehicle::face, Creature::facing, vehicle::get_all_parts(), get_map(), map::get_vehicles(), vehicle::global_pos3(), vehicle::is_moving(), max(), vehicle_part::mount, temperatures::normal, Creature::posx(), Creature::posy(), Creature::posz(), units::sin(), om_direction::size, sqrt(), wrapped_vehicle::v, point::x, tripoint::xy(), and point::y.
Referenced by move().
| bool npc::wants_take_that | ( | const item & | it | ) |
Definition at line 3802 of file npcmove.cpp.
References Character::get_wielded_item(), good, has_item_whitelist(), item_whitelisted(), minimum_item_value(), null_item_reference(), value(), and Character::weapon_value().
Referenced by anonymous_namespace{npcmove.cpp}::good_for_pickup(), and npc_pickup_from_stack().
Definition at line 1847 of file npc.cpp.
References _, item::active, flag_BOMB, flag_DANGEROUS, flag_TRADER_AVOID, npc_class::get_shopkeeper_blacklist(), item::has_flag(), Character::has_trait(), item::has_var(), item::is_filthy(), is_shopkeeper(), ret_val< T >::make_failure(), ret_val< T >::make_success(), shopkeeper_blacklist::matches(), icg_entry::message, myclass, trait_SQUEAMISH, translation::translated(), VAR_TRADE_IGNORE, and will_exchange_items_freely().
| bool npc::wants_to_buy | ( | const item & | it | ) | const |
Definition at line 1842 of file npc.cpp.
References value().
Referenced by anonymous_namespace{npctrade.cpp}::_trading_price(), trade_preset::get_denial(), and npc_trading::transfer_items().
| bool npc::wants_to_recharge_cbm | ( | ) |
Definition at line 2276 of file npcmove.cpp.
References npc_follower_rules::cbm_recharge, Character::get_fueled_bionics(), Character::get_max_power_level(), Character::get_power_level(), Character::has_active_bionic(), and rules.
Referenced by address_needs().
| bool npc::wants_to_sell | ( | const item_location & | it | ) | const |
Definition at line 1806 of file npc.cpp.
References item::is_owned_by(), and value().
Referenced by anonymous_namespace{npctrade.cpp}::_trading_price(), bionic_install_surgeon_preset::get_denial(), trade_preset::get_denial(), npc_trading::init_selling(), and npc_trading::transfer_items().
| ret_val< void > npc::wants_to_sell | ( | const item_location & | it, |
| int | at_price | ||
| ) | const |
Definition at line 1814 of file npc.cpp.
References _, flag_TRADER_KEEP, flag_TRADER_KEEP_EQUIPPED, npc_class::get_shopkeeper_items(), item_group::group_contains_item(), item::has_flag(), item_location::held_by(), Character::is_worn(), ret_val< T >::make_failure(), ret_val< T >::make_success(), myclass, npc_class::sells_belongings, item::this_or_single_content(), item::typeId(), and will_exchange_items_freely().
| void npc::warn_about | ( | const std::string & | type, |
| const time_duration & | d = 10_minutes, |
||
| const std::string & | name = "", |
||
| int | range = -1, |
||
| const tripoint & | danger_pos = tripoint_zero |
||
| ) |
Definition at line 5153 of file npcmove.cpp.
References _, sounds::alert, chat_snippets(), complain_about(), direction_from(), direction_name(), distance_string(), Character::has_trait(), is_enemy(), Character::name, Creature::pos(), dialogue_chatbin_snippets::snip_cant_flee, dialogue_chatbin_snippets::snip_combat_noise_warning, dialogue_chatbin_snippets::snip_fire_bad, dialogue_chatbin_snippets::snip_fire_in_the_hole, dialogue_chatbin_snippets::snip_fire_in_the_hole_h, dialogue_chatbin_snippets::snip_general_danger, dialogue_chatbin_snippets::snip_general_danger_h, dialogue_chatbin_snippets::snip_heal_self, dialogue_chatbin_snippets::snip_its_safe, dialogue_chatbin_snippets::snip_its_safe_h, dialogue_chatbin_snippets::snip_kill_npc, dialogue_chatbin_snippets::snip_kill_npc_h, dialogue_chatbin_snippets::snip_kill_player_h, dialogue_chatbin_snippets::snip_monster_warning, dialogue_chatbin_snippets::snip_monster_warning_h, dialogue_chatbin_snippets::snip_movement_noise_warning, dialogue_chatbin_snippets::snip_run_away, dialogue_chatbin_snippets::snip_speech_warning, sounds::speech, speech, string_format(), trait_IGNORE_SOUND, translation::translated(), and type.
Referenced by act_on_danger_assessment(), assess_danger(), escape_explosion(), handle_sound(), heal_self(), move_to(), and regen_ai_cache().
| bool npc::wear_if_wanted | ( | const item & | it, |
| std::string & | reason | ||
| ) |
Definition at line 1233 of file npc.cpp.
References _, bp, Character::can_wear(), chat_snippets(), item::covers(), effect_mending, outfit::empty(), outfit::first_item_covering_bp(), flag_SPLINT, Creature::get_all_body_parts(), Creature::has_effect(), item::has_flag(), int_id< T >::id(), item::is_armor(), Character::is_limb_broken(), only_main, outfit::size(), dialogue_chatbin_snippets::snip_wear, Character::takeoff(), translation::translated(), Character::wear_item(), and Character::worn.
Referenced by talker_npc::give_item_to(), and game::npc_menu().
|
overridevirtual |
Removes currently wielded item (if any) and replaces it with the target item.
| target | replacement item to wield or null item to remove existing weapon without replacing it |
Implements Character.
Definition at line 1327 of file npc.cpp.
References _, add_msg_if_npc(), Character::cached_info, item::can_combine(), character_wields_item, item::combine(), get_event_bus(), get_player_view(), Character::get_wielded_item(), Character::getID(), visitable::has_item(), Character::has_wield_conflicts(), Character::invalidate_inventory_validity_cache(), Character::invalidate_leak_level_cache(), invalidate_range_cache(), item::is_null(), Character::is_wielding(), item, m_info, Creature::mod_moves(), item::on_wield_cost(), Creature::pos(), visitable::remove_item(), Character::sees(), event_bus::send(), event_bus::send_with_talker(), Character::set_wielded_item(), stow_item(), item::tname(), item::typeId(), and Character::weapon.
Referenced by talker_npc::give_item_to(), npc_attack_melee::use(), npc_attack_gun::use(), npc_attack_throw::use(), npc_attack_activate_item::use(), and wield_better_weapon().
| bool npc::wield_better_weapon | ( | ) |
Definition at line 4111 of file npcmove.cpp.
References add_msg_debug, debugmsg, debugmode::DF_NPC, evaluate_best_weapon(), evaluate_weapon(), itype::get_id(), Character::get_wielded_item(), npc_follower_rules::has_flag(), is_player_ally(), null_item_reference(), rules, string_id< T >::str(), item::tname(), item::type, use_guns, use_silent, Character::weapon, and wield().
Referenced by talker_npc::clear_ai_rule(), move_pause(), scan_new_items(), talker_npc::set_ai_rule(), and talker_npc::toggle_ai_rule().
| bool npc::will_accept_from_player | ( | const item & | it | ) | const |
Is the item safe or does the NPC trust you enough? Is not recursive, only checks the item that is the parameter.
to check contents, call this on the items inside the item.
Definition at line 3263 of file npc.cpp.
References flag_NPC_SAFE, item::get_comestible_fun(), get_player_character(), item::has_flag(), Character::has_trait(), item::is_comestible(), is_hallucination(), is_minion(), item::poison, trait_DEBUG_MIND_CONTROL, item::type, and itype::use_methods.
Referenced by try_consume().
| bool npc::will_exchange_items_freely | ( | ) | const |
Definition at line 1875 of file npc.cpp.
References is_player_ally().
Referenced by trade_ui::_draw_header(), npc_trading::calc_npc_owes_you(), npc_trading::init_selling(), npc_trading::npc_will_accept_trade(), npc_trading::trade(), trade_ui::trade_ui(), wants_to_buy(), and wants_to_sell().
| bool npc::within_boundaries_of_camp | ( | ) | const |
Definition at line 2337 of file npc.cpp.
References overmapbuffer::find_camp(), Creature::global_omt_location(), Character::nearby(), overmap_buffer, and point.
|
overridevirtual |
Implements Creature.
Definition at line 1944 of file npcmove.cpp.
References known_stolen_item, myclass, NC_EVAC_SHOPKEEP, NPCATT_RECOVER_GOODS, and set_attitude().
Definition at line 2715 of file npcmove.cpp.
References ai_cache, ally, confident_shoot_range(), confident_throw_range(), coord_to_angle(), units::fabs(), npc_short_term_cache::friends, min(), Creature::pos(), Character::recoil_total(), and rl_dist().
Referenced by alt_attack(), npc_attack_gun::evaluate_tripoint(), npc_attack_throw::evaluate_tripoint(), npc_attack_gun::use(), and npc_attack_throw::use().
| void npc::worker_downtime | ( | ) |
Definition at line 3289 of file npcmove.cpp.
References assigned_camp, chair_pos, could_move_onto(), creature_tracker::creature_at(), overmapbuffer::find_camp(), g, basecamp::get_bb_pos(), get_creature_tracker(), Creature::get_location(), get_map(), map::getabs(), map::getglobal(), map::getlocal(), map::has_flag(), map::has_flag_furn(), map::has_floor_or_water(), Character::is_mounted(), move_pause(), move_to_next(), one_in(), overmap_buffer, path, map::point_within_camp(), map::points_in_radius(), Creature::pos(), random_entry(), TFLAG_CAN_SIT, TFLAG_DEEP_WATER, tripoint_zero, update_path(), and wander_pos.
Referenced by execute_action().
Definition at line 3817 of file npcmove.cpp.
References add_msg_debug, npc_personality::aggression, npc_personality::collector, debugmode::DF_NPC_ITEMAI, overmapbuffer::find_npc(), g, get_faction(), Character::get_name(), get_player_character(), get_player_view(), has_faction_relationship(), item::is_owned_by(), npc_factions::kill_on_sight, overmap_buffer, personality, player, viewer::sees(), item::tname(), and faction_template::trusts_u.
Referenced by anonymous_namespace{npcmove.cpp}::good_for_pickup().
|
private |
Definition at line 1348 of file npc.h.
Referenced by address_needs(), alt_attack(), assess_danger(), attitude_to(), avoid_friendly_fire(), closest_enemy_to_friendly_distance(), current_ally(), current_target(), danger_assessment(), emergency(), escape_explosion(), evaluate_best_attack(), evaluate_best_weapon(), evaluate_self(), execute_action(), find_item(), get_cached_friends(), get_current_attack(), get_current_attack_evaluation(), go_to_omt_destination(), good_escape_direction(), handle_sound(), heal_player(), heal_self(), is_safe(), method_of_attack(), move(), npc(), reboot(), regen_ai_cache(), set_guard_pos(), update_path(), and wont_hit_friend().
| std::optional<tripoint_abs_omt> npc::assigned_camp = std::nullopt |
Definition at line 1333 of file npc.h.
Referenced by die(), faction_display(), import_and_clean(), move(), mutiny(), talk_function::stop_guard(), and worker_downtime().
|
private |
Definition at line 1342 of file npc.h.
Referenced by address_player(), basic_symbol_color(), extended_description(), form_opinion(), get_attitude(), has_activity(), has_player_activity(), is_ally(), is_enemy(), is_following(), is_leader(), is_walking_with(), load_npc_template(), long_term_goal_action(), move(), move_to(), npc(), revert_after_activity(), and set_attitude().
| std::optional<tripoint_abs_omt> npc::base_location |
Definition at line 1374 of file npc.h.
Referenced by decide_needs(), and reach_omt_destination().
| std::optional<tripoint_abs_ms> npc::chair_pos |
Definition at line 1373 of file npc.h.
Referenced by import_and_clean(), and worker_downtime().
| dialogue_chatbin npc::chatbin |
Definition at line 1406 of file npc.h.
Referenced by talker_npc::add_mission(), add_new_mission(), talk_function::assign_camp(), talk_function::assign_guard(), talk_function::assign_mission(), talker_npc::assigned_missions(), assigned_missions_value(), talker_npc::available_missions(), npc_template::check_consistency(), talker_npc::check_missions(), talk_function::clear_mission(), debug_menu::mission_debug::edit_npc(), talk_function::end_conversation(), get_specified_talk_topic(), talker_npc::get_topics(), talk_function::goto_location(), import_and_clean(), talk_function::insult_combat(), mission::is_complete(), talk_function::leave(), npc_template::load(), load_npc_template(), talk_function::mission_failure(), talk_function::mission_reward(), talk_function::mission_success(), mutiny(), talk_function::npc_thankful(), pick_talk_topic(), regen_ai_cache(), debug_menu::mission_debug::remove_mission(), game::reset_npc_dispositions(), talker_npc::select_mission(), talker_npc::selected_mission(), talker_npc::set_first_topic(), talk_function::start_training(), talk_function::start_training_gen(), talk_function::start_training_npc(), talk_function::start_training_seminar(), talk_function::stop_guard(), talker_npc::store_chosen_training(), talk_function::stranger_neutral(), talker_npc::update_missions(), and update_missions_target().
| weak_ptr_fast<monster> npc::chosen_mount |
Definition at line 816 of file npc.h.
Referenced by talk_function::find_mount(), and activity_handlers::find_mount_do_turn().
|
private |
Definition at line 1475 of file npc.h.
Referenced by get_companion_mission(), get_mission_destination(), has_companion_mission(), reset_companion_mission(), and set_companion_mission().
| inventory npc::companion_mission_inv |
Definition at line 1399 of file npc.h.
Referenced by talk_function::companion_return(), farm_action(), basecamp::finish_return(), import_and_clean(), om_harvest_ter(), and om_set_hide_site().
| std::vector<tripoint_abs_omt> npc::companion_mission_points |
Definition at line 1395 of file npc.h.
Referenced by talk_function::companion_return(), basecamp::finish_return(), and import_and_clean().
| std::string npc::companion_mission_role_id |
Definition at line 1393 of file npc.h.
Referenced by talk_function::companion_choose_return(), talk_function::companion_list(), talk_function::companion_mission(), talker_npc::enslave_mind(), conditional_fun::anonymous_namespace{condition.cpp}::f_npc_role_nearby(), import_and_clean(), talk_function::individual_mission(), talker_npc::set_companion_mission(), and set_companion_mission().
| time_point npc::companion_mission_time |
Definition at line 1396 of file npc.h.
Referenced by talk_function::companion_return(), basecamp::finish_return(), import_and_clean(), update_emergency_recall(), and update_time_fixed().
| time_point npc::companion_mission_time_ret |
Definition at line 1398 of file npc.h.
Referenced by basecamp::companion_crafting_choose_return(), talk_function::companion_return(), faction_display(), basecamp::finish_return(), import_and_clean(), basecamp::start_multi_mission(), and update_time_left().
|
private |
Definition at line 1346 of file npc.h.
Referenced by complain_about(), and import_and_clean().
| std::optional<int> npc::confident_range_cache |
Definition at line 1413 of file npc.h.
Referenced by assess_danger(), invalidate_range_cache(), and move().
| activity_id npc::current_activity_id = activity_id::NULL_ID() |
Definition at line 1328 of file npc.h.
Referenced by Character::assign_activity(), complete_construction(), do_player_activity(), get_current_activity(), import_and_clean(), name_and_activity(), parse_tags(), revert_after_activity(), and set_mission().
|
private |
| bool npc::fetching_item = false |
Definition at line 1386 of file npc.h.
Referenced by find_item(), move(), npc(), pick_up_item(), and reboot().
| tripoint_abs_omt npc::goal |
Global overmap terrain coordinate, where we want to get to if no goal exist, this is no_goal_point.
Definition at line 1379 of file npc.h.
Referenced by debug_menu::character_edit_menu(), talker_npc::distance_to_goal(), talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_npc_goal(), go_to_omt_destination(), talk_function::goto_location(), guard_current_pos(), has_omt_destination(), import_and_clean(), talk_function::lead_to_safety(), move(), npc(), reach_omt_destination(), reboot(), regen_ai_cache(), set_omt_destination(), talk_function::stop_guard(), and travel_overmap().
|
private |
Definition at line 1350 of file npc.h.
Referenced by set_omt_destination().
| std::optional<tripoint_abs_ms> npc::goto_to_this_pos |
Definition at line 1363 of file npc.h.
Referenced by execute_action(), and move().
| std::optional<tripoint_abs_ms> npc::guard_pos |
Definition at line 1371 of file npc.h.
Referenced by talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_npc_goal(), talk_function::goto_location(), guard_current_pos(), import_and_clean(), npc(), reach_omt_destination(), reboot(), and talk_function::stop_guard().
| bool npc::hallucination = false |
Definition at line 1411 of file npc.h.
Referenced by is_hallucination(), npc(), and on_load().
| bool npc::has_new_items = false |
Definition at line 1387 of file npc.h.
Referenced by do_reload(), talker_npc::give_item_to(), move(), npc(), on_load(), pick_up_item(), randomize(), reboot(), and scan_new_items().
| bool npc::hit_by_player = false |
Definition at line 1410 of file npc.h.
Referenced by die(), extended_description(), npc(), and on_attacked().
| string_id<npc_template> npc::idz |
Definition at line 1330 of file npc.h.
Referenced by jmapgen_remove_npcs::apply(), chat_snippets(), npc_template::load(), load_npc_template(), and npc().
| job_data npc::job |
Definition at line 1416 of file npc.h.
Referenced by find_job_to_perform(), generic_multi_activity_check_requirement(), generic_multi_activity_handler(), has_job(), import_and_clean(), basecamp::job_assignment_ui(), talk_function::leave(), and mutiny().
| item* npc::known_stolen_item = nullptr |
Definition at line 1382 of file npc.h.
Referenced by talk_function::drop_stolen_item(), regen_ai_cache(), talk_function::remove_stolen_status(), and witness_thievery().
|
private |
Definition at line 1344 of file npc.h.
Referenced by get_known_to_u(), set_fac(), and set_known_to_u().
| std::optional<tripoint_abs_ms> npc::last_player_seen_pos |
Definition at line 1361 of file npc.h.
Referenced by execute_action(), import_and_clean(), npc(), reboot(), and saw_player_recently().
| int npc::last_seen_player_turn = 0 |
Definition at line 1364 of file npc.h.
Referenced by npc(), reboot(), and saw_player_recently().
| bool npc::marked_for_death = false |
Definition at line 1409 of file npc.h.
Referenced by overmap_ui::draw_ascii(), npc(), and prevent_death().
| npc_combat_memory_cache npc::mem_combat |
Definition at line 1404 of file npc.h.
Referenced by act_on_danger_assessment(), assess_danger(), evaluate_character(), evaluate_self(), find_corpse_to_pulp(), good_escape_direction(), regen_ai_cache(), and npc_attack_melee::use().
| std::vector<mission_type_id> npc::miss_ids |
Definition at line 1332 of file npc.h.
Referenced by npc_template::load(), and load_npc_template().
| npc_mission npc::mission = NPC_MISSION_NULL |
Definition at line 1400 of file npc.h.
Referenced by overmap_ui::draw_ascii(), import_and_clean(), talk_function::leave(), npc_template::load(), load_npc_template(), anonymous_namespace{do_turn.cpp}::overmap_npc_move(), game::reset_npc_dispositions(), and set_mission().
| npc_class_id npc::myclass |
Definition at line 1329 of file npc.h.
Referenced by anonymous_namespace{npctrade_utils.cpp}::_consume_item(), debug_menu::character_edit_menu(), npc_template::check_consistency(), describe_mission(), get_price_rules(), iexamine::intercom(), mission::is_complete(), talker_npc::is_myclass(), is_shopkeeper(), npc_template::load(), load_npc_template(), npc(), mission_start::place_npc_software(), randomize(), talker_npc::set_class(), shop_restock(), wants_to_buy(), wants_to_sell(), and witness_thievery().
|
static |
Definition at line 1136 of file npc.h.
Referenced by get_location_for(), and get_need_str_id().
| std::vector<npc_need> npc::needs |
Definition at line 1412 of file npc.h.
Referenced by debug_menu::character_edit_menu(), decide_needs(), form_opinion(), reach_omt_destination(), and set_omt_destination().
|
staticconstexpr |
Definition at line 1415 of file npc.h.
Referenced by talk_effect_fun::anonymous_namespace{npctalk.cpp}::f_npc_goal(), go_to_omt_destination(), talk_function::goto_location(), has_omt_destination(), anonymous_namespace{do_turn.cpp}::overmap_npc_move(), reach_omt_destination(), reboot(), set_omt_destination(), and talk_function::stop_guard().
| npc_opinion npc::op_of_u |
Definition at line 1403 of file npc.h.
Referenced by talker_npc::add_debt(), talker_npc::add_opinion(), talker_npc::add_sold(), npc_trading::calc_npc_owes_you(), debug_menu::character_edit_menu(), debug_menu::character_edit_opinion_menu(), talker_npc::check_hostile_response(), talker_npc::debt(), form_opinion(), talker_npc::get_npc_anger(), talker_npc::get_npc_fear(), talker_npc::get_npc_trust(), talker_npc::get_npc_value(), get_opinion_values(), talker_npc::get_topics(), talk_function::give_equipment_allowance(), good_escape_direction(), hostile_anger_level(), is_minion(), make_angry(), max_credit_extended(), max_willing_to_owe(), talk_function::mission_failure(), talk_function::mission_reward(), talk_function::mission_success(), talk_function::morale_chat_activity(), move(), mug_player(), mutiny(), game::npc_menu(), opinion_text(), talker_npc::parse_mod(), npc_trading::pay_npc(), pick_talk_topic(), process_turn(), game::reset_npc_dispositions(), talker_npc::set_npc_anger(), talker_npc::set_npc_fear(), talker_npc::set_npc_trust(), talker_npc::set_npc_value(), talker_npc::sold(), trade_ui::trade_ui(), talker_npc::trial_chance_mod(), turned_hostile(), and npc_trading::update_npc_owed().
| std::vector<tripoint> npc::path |
Definition at line 1390 of file npc.h.
Referenced by act_on_danger_assessment(), assess_danger(), execute_action(), export_to(), find_item(), go_to_omt_destination(), good_escape_direction(), import_and_clean(), move(), move_to(), move_to_next(), pick_up_item(), reach_omt_destination(), reboot(), regen_ai_cache(), shift(), update_path(), npc_attack_melee::use(), and worker_downtime().
| int npc::patience = 0 |
Definition at line 1407 of file npc.h.
Referenced by address_player(), npc(), talk_function::player_leaving(), and reboot().
| npc_personality npc::personality |
Definition at line 1402 of file npc.h.
Referenced by act_on_danger_assessment(), assess_danger(), bravery_check(), debug_menu::character_edit_menu(), debug_menu::character_edit_personality_menu(), emergency(), evaluate_character(), evaluate_self(), form_opinion(), generate_personality_traits(), good_escape_direction(), hostile_anger_level(), make_angry(), max_credit_extended(), max_willing_to_owe(), minimum_item_value(), move(), mug_player(), talk_function::npc_thankful(), talker_npc::parse_mod(), pick_talk_topic(), talk_function::player_leaving(), randomize(), talker_npc::trial_chance_mod(), npc_attack_melee::use(), and would_take_that().
|
private |
Definition at line 1466 of file npc.h.
Referenced by die(), and prevent_death().
|
private |
Definition at line 1343 of file npc.h.
Referenced by get_previous_attitude(), revert_after_activity(), and set_attitude().
| npc_mission npc::previous_mission = NPC_MISSION_NULL |
Definition at line 1401 of file npc.h.
Referenced by get_previous_mission(), import_and_clean(), revert_after_activity(), and set_mission().
| std::optional<tripoint_abs_ms> npc::pulp_location |
Definition at line 1384 of file npc.h.
Referenced by address_needs(), can_do_pulp(), find_corpse_to_pulp(), import_and_clean(), and activity_handlers::pulp_finish().
|
private |
Definition at line 1460 of file npc.h.
Referenced by check_or_use_weapon_cbm(), and discharge_cbm_weapon().
| time_point npc::restock |
Definition at line 1385 of file npc.h.
Referenced by get_restock_interval(), and shop_restock().
| npc_follower_rules npc::rules |
Definition at line 1408 of file npc.h.
Referenced by address_needs(), alt_attack(), assess_danger(), can_move(), can_move_melee(), can_open_door(), npc_attack_spell::can_use(), npc_attack_throw::can_use(), npc_attack_activate_item::can_use(), can_use_offensive_cbm(), check_or_use_weapon_cbm(), talker_npc::clear_ai_rule(), talk_function::clear_overrides(), complain_about(), confidence_mult(), talk_function::copy_npc_rules(), npc_attack_throw::evaluate(), evaluate_best_attack(), evaluate_best_weapon(), npc_attack_spell::evaluate_tripoint(), npc_attack_gun::evaluate_tripoint(), npc_attack_throw::evaluate_tripoint(), find_corpse_to_pulp(), find_item(), follow_distance(), get_path_avoid(), good_escape_direction(), handle_sound(), talker_npc::has_ai_rule(), has_item_whitelist(), item_name_whitelisted(), move(), move_to(), npc_temp_orders_menu(), pick_up_item(), talker_npc::set_ai_rule(), talk_function::set_npc_pickup(), smash_ability(), talker_npc::toggle_ai_rule(), npc_attack_gun::use(), npc_attack_throw::use(), talk_function::wake_up(), wants_to_recharge_cbm(), and wield_better_weapon().
|
private |
Definition at line 1477 of file npc.h.
Referenced by get_unique_id(), import_and_clean(), on_move(), and set_unique_id().
| std::optional<tripoint_abs_ms> npc::wander_pos |
Definition at line 1381 of file npc.h.
Referenced by import_and_clean(), and worker_downtime().
| item_location npc::wanted_item = {} |
Definition at line 1367 of file npc.h.
Referenced by find_item(), and pick_up_item().
| tripoint npc::wanted_item_pos |
Definition at line 1369 of file npc.h.
Referenced by find_item(), npc(), pick_up_item(), reboot(), and shift().
| int npc::worst_item_value = 0 |
Definition at line 1388 of file npc.h.
Referenced by npc(), pick_up_item(), reboot(), and update_worst_item_value().